jquery.nicescroll.min.js滚动条使用方法,Nicescroll 是制作自定义滚动条的jq插件。支持div,iframe,html等使用,兼容IE7-8,safari,firefox,webkit内核浏览器(chrome,safari)以及智能终端设备浏览器的滚动条。

页面使用:

$("html").niceScroll({ 
cursorcolor:"#E62020", 
cursoropacitymax:1, 
touchbehavior:false, 
cursorwidth:"10px", 
cursorborder:"0", 
cursorborderradius:"5px"

})

nicescroll详细参数配置:

cursorcolor - 设置滚动条颜色,默认值是“#000000”
cursoropacitymin - 滚动条透明度最小值
cursoropacitymax - 滚动条透明度最大值
cursorwidth - 滚动条的宽度像素,默认为5(你可以写“5PX”)
cursorborder - CSS定义边框,默认为“1px solid #FFF”
cursorborderradius - 滚动条的边框圆角
ZIndex的 - 改变滚动条的DIV的z-index值,默认值是9999
scrollspeed - 滚动速度,默认值是60
mousescrollstep - 滚动鼠标滚轮的速度,默认值是40(像素)
touchbehavior - 让滚动条能拖动滚动触摸设备默认为false
hwacceleration - 使用硬件加速滚动支持时,默认为true
boxzoom - 使变焦框的内容,默认为false
dblclickzoom - (仅当boxzoom = TRUE)变焦启动时,双点击框,默认为true
gesturezoom - boxzoom = true并使用触摸设备)变焦(仅当激活时,间距/盒,默认为true
grabcursorenabled“抢”图标,显示div的touchbehavior = true时,默认值是true
autohidemode,如何隐藏滚动条的作品,真正的默认/“光标”=只光标隐藏/ FALSE =不隐藏
的背景下,改变铁路背景的CSS,默认值为“”
iframeautoresize中,AUTORESIZE iframe上的load事件(默认:true)
cursorminheight,设置最低滚动条高度(默认值:20)
preservenativescrolling,您可以用鼠标滚动本地滚动的区域,鼓泡鼠标滚轮事件(默认:true)
railoffset,您可以添加抵消顶部/左轨位置(默认:false)
bouncescroll,使滚动反弹结束时的内容移动(仅硬件ACCELL)(默认:FALSE)
spacebarenabled,允许使用空格键滚动(默认:true)
railpadding,设置间距(默认:顶:0,右:0,左:0,底部:0})
disableoutline,Chrome浏览器,禁用纲要(橙色hightlight)时,选择一个div nicescroll(默认:true)

官方参数说明:

cursorcolor - change cursor color in hex, default is "#000000"
. cursoropacitymin - change opacity very cursor is inactive (scrollabar "hidden" state), range from 1 to 0, default is 0 (hidden)
. cursoropacitymax - change opacity very cursor is active (scrollabar "visible" state), range from 1 to 0, default is 1 (full opacity)
. cursorwidth - cursor width in pixel, default is 5 (you can write "5px" too)
. cursorborder - css definition for cursor border, default is "1px solid #fff"
. cursorborderradius - border radius in pixel for cursor, default is "4px"
. zindex - change z-index for scrollbar div, default value is 9999
. scrollspeed - scrolling speed, default value is 60
. mousescrollstep - scrolling speed with mouse wheel, default value is 40 (pixel)
. touchbehavior - enable cursor-drag scrolling like touch devices in desktop computer, default is false
. hwacceleration - use hardware accelerated scroll when supported, default is true
. boxzoom - enable zoom for box content, default is false
. dblclickzoom - (only when boxzoom=true) zoom activated when double click on box, default is true
. gesturezoom - (only when boxzoom=true and with touch devices) zoom activated when pinch out/in on box, default is true
. grabcursorenabled, display "grab" icon for div with touchbehavior = true, default is true
. autohidemode, how hide the scrollbar works, true=default / "cursor" = only cursor hidden / false = do not hide
. background, change css for rail background, default is ""
. iframeautoresize, autoresize iframe on load event (default:true)
. cursorminheight, set the minimum cursor height in pixel (default:20)
. preservenativescrolling, you can scroll native scrollable areas with mouse, bubbling mouse wheel event (default:true)
. railoffset, you can add offset top/left for rail position (default:false)
. bouncescroll, enable scroll bouncing at the end of content as mobile-like (only hw accell) (default:false)
. spacebarenabled, enable page down scrolling when space bar has pressed (default:true)
. railpadding, set padding for rail bar (default:{top:0,right:0,left:0,bottom:0})
. disableoutline, for chrome browser, disable outline (orange hightlight) when selecting a div with nicescroll (default:true)
. horizrailenabled, nicescroll can manage horizontal scroll (default:true)
. railalign, alignment of vertical rail (defaul:"right")
. railvalign, alignment of horizontal rail (defaul:"bottom")
. enabletranslate3d, nicescroll can use css translate to scroll content (default:true)
. enablemousewheel, nicescroll can manage mouse wheel events (default:true)
. enablekeyboard, nicescroll can manage keyboard events (default:true)
. smoothscroll, scroll with ease movement (default:true)
. sensitiverail, click on rail make a scroll (default:true)
. enablemouselockapi, can use mouse caption lock API (same issue on object dragging) (default:true)
. cursorfixedheight, set fixed height for cursor in pixel (default:false)
 

页面使用:

<!--<script type="text/javascript">

$(document).ready(function(){

$(".content_box").niceScroll();

  //$("html").niceScroll();

});

</script>-->

content_box为滚动内容容器

只需以上两步即可使用,无需css等。

下载地址:jquery.nicescroll.min.js点击下载

http://areaaperta.com/nicescroll/  官网

本文由红蜘蛛网络联盟(www.rswebun.com)整理编辑。

jquery.nicescroll.min.js滚动条使用方法的更多相关文章

  1. jquery.nicescroll.min.js滚动条插件的用法

    1.jquery.nicescroll.min.js源码 /* jquery.nicescroll 3.6.8 InuYaksa*2015 MIT http://nicescroll.areaaper ...

  2. jquery.validate.min.js 用法方法示例

    页面html 代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w ...

  3. Uncaught TypeError: Cannot read property &#39;call&#39; of undefined jquery.validate.min.js:28

    最近在做表单验证时,,自己写的addMethod 方法总是不起作用.折腾了将近一天. 报告的错误,如下面的 Uncaught TypeError: Cannot read property 'call ...

  4. web下c#用jquery.tmpl.min.js插件实现分页查询_yginuo

    背景:webform或者mvc下实现插件快速分页 ps:我这里用的mvc开发的,数据库连接.用的ADO.NET实体数据模型 此案例下载地址(内含需要用到的一个插件与数据库):http://downlo ...

  5. 为网页生成二维码(jquery.qrcode.min.js)

    做网站活动页面的时候,要为每个活动生成一个二维码,虽然简单,但还是习惯记录下来. jquery.qrcode.min.js是js的一个库,主流的浏览器都支持:IE6~10, Chrome, Firef ...

  6. jQuery Validate验证框架详解(jquery.validate.min.js)

    原博客 jQuery Validate验证框架详解 jQuery校验官网地址:https://jqueryvalidation.org/ 一.导入js库 <script type="t ...

  7. jquery.imgpreload.min.js插件实现页面图片预加载

    页面分享地址: http://wenku.baidu.com/link?url=_-G8miwbgDmEj6miyFtjit1duJggBCJmFjR2jky_G1VftD9eS9kwGOlFWAOR ...

  8. jquery.qrcode.min.js生成二维码

    jquery.qrcode.min.js是一款可以生成二维码的插件,使用前提是先引入jquery,因为jquery.qrcode.min.js依赖jquery. 基本用法 1.引入js <scr ...

  9. jquery.serializejson.min.js的妙用

    关于这个jquery.serializejson.min.js插件来看,他是转json的一个非常简单好用的插件. 前端在处理含有大量数据提交的表单时,除了使用Form直接提交刷新页面之外,经常碰到的需 ...

随机推荐

  1. 如何在Power BI和Tableau之间进行选择?

    作者:Mike Gallucci 如今,当谈到商业智能(BI)分析软件时,有两个主要的行业领导者 - 微软的Power BI和Tableau.根据分析和业务平台的2018年Gartner Magic ...

  2. 第七十七课 最小生成树(Kruskal)

    添加kruskal算法: #ifndef GRAPH_H #define GRAPH_H #include "Object.h" #include "SharedPoin ...

  3. mysql 批量kill

    select concat('kill ',id,';') t  from information_schema.processlist  order by t

  4. Android反调试笔记

    1)代码执行时间检测 通过取系统时间,检测关键代码执行耗时,检测单步调试,类似函数有:time,gettimeofday,clock_gettime. 也可以直接使用汇编指令RDTSC读取,但测试AR ...

  5. C++ 中时钟函数的使用

    头文件: #incllude <time.h> 定义: clock_t var1, var2; 获取时间: var1 = clock(); 每过千分之一秒(1毫秒),调用clock()函数 ...

  6. 使用NATS替换NSQ为后台服务解耦

    简介 满世界的后台都在向微服务架构发展,我对微服务的理解是将一个复杂的业务分拆为多个服务,由多个服务协作完成一个服务:在后台微服务架构时需要考虑高可用.一致性等问题,也要考虑在实现上.编码上的复杂程度 ...

  7. 关于Adaboost——样本抽样的权值的实际意义

    看这篇文章的前提:已经看了PRML中的Adaboost的算法流程 看懂下面的内容必须牢牢记住:Adaboost使用的误差函数是指数误差 文章主要目的:理解样本抽样的权值是为什么那样变化的. 得出的结论 ...

  8. Oracle使用笔记(一)

    目录 一.创建表: 二.编辑表数据: 三.Oracle基本数据类型: (一) 字符串类型 1.1:CHAR类型 CHAR(size [BYTE | CHAR]) 1.2: NCHAR类型 1.3 VA ...

  9. SSAS aggregation 的作用及其使用

    作用: 聚合是为了解决查询在运行时的效率低下,在数据立方体部署的时候进行聚合,实际上是对数据立方体的预处理,方便以后查询.如若在部署时未进行聚合,则在以后每次查询时实际上都会进行一次集合的操作,等待结 ...

  10. ionic中 ng-repeat下使用ng-model获取不到选中数据问题:

    在这种情况下点击了单选框并不能获取$scope.unitcode的值: <ion-list> <ion-radio ng-repeat="item in userInfos ...