jquery.nicescroll参数说明
发布日期:2021-06-30 16:23:20 浏览次数:4 分类:技术文章

本文共 3611 字,大约阅读时间需要 12 分钟。

 

始终初始化nicscroll(文档)就绪语句。

// 1. Simple mode, it styles document scrollbar:$(function() {      $("body").niceScroll();});// 2. Instance with object returned:var nice = false;$(function() {      nice = $("body").niceScroll();});// 3. Style a DIV and change cursor color:$(function() {      $("#thisdiv").niceScroll({cursorcolor:"#00F"});});// 4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content:$(function() {    $("#viewportdiv").niceScroll("#wrapperdiv",{cursorcolor:"#00F"});});// 5. Get nicescroll object:var nice = $("#mydiv").getNiceScroll();// 6. Hide scrollbars:$("#mydiv").getNiceScroll().hide();// 7. Check for scrollbars resize (when content or position have changed):$("#mydiv").getNiceScroll().resize();// 8. Scrolling to a position:$("#mydiv").getNiceScroll(0).doScrollLeft(x, duration); // Scroll X Axis$("#mydiv").getNiceScroll(0).doScrollTop(y, duration); // Scroll Y Axis
$("#thisdiv").niceScroll({     cursorcolor: "#424242",//  更改十六进制中的光标颜色     cursoropacitymin: 0,//  在光标处于非活动状态时更改不透明度(Scrollabar“隐藏的”状态),范围为1到0     cursoropacitymax: 1,//  在光标处于活动状态时更改不透明度(滚动条“可见”状态),范围为1到0     cursorwidth: "5px",//  光标宽度在像素中(您也可以写“5px”)     cursorborder: "1px solid #fff",//  光标边框的CSS定义     cursorborderradius: "5px",//  边框半径为光标的像素     zindex: "auto" | [number],//  更改滚动条div的z-index     scrollspeed: 60,//  滚动速度     mousescrollstep: 40,//  滚动速度鼠标滚轮(像素)     touchbehavior: false,//  弃用!!使用“emulateTouch”     emulatetouch: false,//  使能像桌面计算机中的触摸设备等光标拖动滚动     hwacceleration: true,//  支持时使用硬件加速滚动     boxzoom: false,//  启用zoom for box content     dblclickzoom: true,//  仅当boxzoom = true时)缩放双击框时激活     gesturezoom: true,//  仅在boxzoom = true和触摸设备时)缩放缩放/在框中缩放     grabcursorenabled: true//  (仅在触摸行为= true)显示“grab”图标     autohidemode: true,//  如何隐藏滚动条工作,可能的值:     /*     true |//  隐藏滚动时       "cursor" |//  只有隐藏的游标       false | //   不要隐藏,       "leave" |//  仅在指针留下内容时隐藏       "hidden" |//  始终隐藏       "scroll",//  只显示滚动     */     background: "",//  更改铁路背景的CSS     iframeautoresize: true,//  自动加载事件上的iframe     cursorminheight: 32,//  设置最小光标高度(像素)     preservenativescrolling: true,//  您可以使用鼠标滚动本机可滚动区域,冒泡鼠标滚轮事件     railoffset: false,//  您可以添加偏移顶/左用于轨道位置     bouncescroll: false,//  (仅限HW Accell)在内容结束时启用滚动弹跳,如移动式     spacebarenabled: true,//  当空格栏按下时启用页面向下滚动     railpadding: { top: 0, right: 0, left: 0, bottom: 0 },//  设置轨道栏的填充     disableoutline: true,//  用于Chrome浏览器,选择与Nicscroll的Div时禁用大纲(橙色突出显示)     horizrailenabled: true,//   nicscroll可以管理水平滚动     railalign: right,//  垂直导轨的对齐     railvalign: bottom,//  水平导轨的对齐     enabletranslate3d: true,//   nicscroll可以使用CSS转换为滚动内容     enablemousewheel: true,//   nicscroll可以管理鼠标轮事件     enablekeyboard: true,//   nicscroll可以管理键盘事件     smoothscroll: true,//  轻松移动滚动     sensitiverail: true,//  单击rail make滚动     enablemouselockapi: true,//  可以使用鼠标标题锁API(对象拖动时相同的问题)     cursorfixedheight: false,//  在像素中设置光标的固定高度     hidecursordelay: 400,//  设置微秒延迟以消失滚动栏     directionlockdeadzone: 6,//   Dead区以像素为单位锁定激活     nativeparentscrolling: true,//  检测内容底部,让父圈滚动,因为本机滚动确实如此     enablescrollonselection: true,//  在选择文本时启用内容的自动滚动     cursordragspeed: 0.3,//  用光标拖动时选择的速度     rtlmode: "auto",//  水平div滚动在左侧开始     cursordragontouch: false,//  在触摸/触摸行为模式下拖动光标     oneaxismousemode: "auto",//  它允许使用鼠标手的水平滚动仅在水平的内容上,如果伪(仅垂直)鼠标手不会水平滚动,如果值为自动检测双轴鼠标     scriptpath: "",//  定义BoxMode图标的自定义路径(“”=>相同的脚本路径)     preventmultitouchscrolling: true//  阻止在multitouch事件上滚动     disablemutationobserver: false//   force mutationobserver禁用,     enableobserver: true//  启用dom更改观察者,它试图调整/隐藏/显示父级或内容div已更改时     scrollbarid: false      //  为nicscroll栏设置自定义ID });

 

转载地址:https://kevin.blog.csdn.net/article/details/116044893 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:windows查看指定的端口是否开放
下一篇:JS判断scroll是否滚动到底部

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年05月04日 02时47分29秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

POJ - 3517 And Then There Was One (约瑟夫环变式) 2019-04-30
HDU - 2068 RPG的错排 (错排+组合数) 2019-04-30
CodeForces 591C Median Smoothing(思维 模拟) 2019-04-30
升级yosemite后java出错的解决 2019-04-30
Spring Cloud Spring Boot b2b2c 微服务 多商家入驻直播商城之Maven 项目模板 2019-04-30
Spring Cloud Spring Boot b2b2c 微服务 多商家入驻直播商城之Maven 项目文档 2019-04-30
Spring Cloud Spring Boot b2b2c 微服务 多商家入驻直播商城之Maven 快照(SNAPSHOT) 2019-04-30
Spring Cloud Spring Boot b2b2c 微服务 多商家入驻直播商城之Maven 自动化构建 2019-04-30
Spring Cloud Spring Boot b2b2c 微服务 多商家入驻直播商城之Maven 依赖管理 2019-04-30
SpringCloud SpringBoot b2b2c 微服务 多商家入驻直播商城之Maven 自动化部署 2019-04-30
SpringCloud SpringBoot b2b2c 微服务 多商家入驻直播商城之Maven Web 应用 2019-04-30
SpringCloud SpringBoot b2b2c 微服务 多商家入驻直播商城之Maven Eclipse 2019-04-30
SpringCloud SpringBoot b2b2c 微服务 多商家入驻直播商城之Maven NetBeans 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis Stream 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis 数据备份与恢复 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis 安全 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis 性能测试 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis 客户端连接 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis 管道技术 2019-04-30
SpringCloud SpringBoot uniapp vue b2b2c 微服务 多商家入驻直播商城之Redis 分区 2019-04-30