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. c++ 编译报错汇总(随时更新)

    1.invalid new-expression of abstract class type ‘×××ב 这个报错代表一个尝试在实例化一个抽象类,也就是说父类的接口中有纯虚函数在子类中没有实现: ...

  2. 搭建使用create-react-native-app 搭建app开发环境

    文档地址 react-native expo 官网 expo 文档 两种创建react-natvie-app的方法 react-native init projectName create-react ...

  3. JS书写规范

    1.js代码是由语句组成的,每一条语句以分号结尾: 语句是有关键字,元素符,表达式组成的:2.js代码严格区分大小写3.所有的标点符号都是英文的4.//表示单行注释,/* */表示多行注释

  4. HDU2023:求平均成绩

    Problem Description 假设一个班有n(n<=50)个学生,每人考m(m<=5)门课,求每个学生的平均成绩和每门课的平均成绩,并输出各科成绩均大于等于平均成绩的学生数量. ...

  5. url参数和字典的相互转化

    目标url:https://www.baidu.com/s?&wd=python&ie=utf-8 将字典转成url参数 使用urllib.parse的urlencode方法,将字典对 ...

  6. 实验吧—安全杂项——WP之 你知道他是谁吗?

    点击链接就可以下载下来一个压缩包 解压后得到一个图片 在百度上可以搜出他是 托马斯·杰斐逊(英语:Thomas Jefferson) 我们将名字输入到flag内,但是不对 我下一步直接用软件NSE查看 ...

  7. hdu2389 Rain on your Parade 二分图匹配--HK算法

    You’re giving a party in the garden of your villa by the sea. The party is a huge success, and every ...

  8. Linux----版本选择

    此文摘自老男孩老师课堂: 下载地址:http://man.linuxde.net/download/

  9. @EnableConfigurationProperties、@EnableAsync、 @EnableTransactionManagement

    ★@ConfigurationProperties和@EnableConfigurationProperties配合使用 @ConfigurationProperties注解主要用来把properti ...

  10. oracle之logminer日志分析

    alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss'; select sysdate from dual; 执行增删操作 alter sy ...