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. 大数据-01-安装Hadoop

    环境 服务器:ubuntu-16.04.3-desktop-amd64.iso 创建hadoop用户 sudo useradd -m hadoop -s /bin/bash 本文中会大量使用到sudo ...

  2. Ajax的简单介绍与使用

    1.什么是Ajax? Ajax(Asynchronous JavaScript and XML),简单说就是不需要刷新当前页面而实现javaScript和和后台服务器交换数据以更新网页中的部分内容. ...

  3. 【转载】 BN(batch normalization)

    原文地址: https://blog.csdn.net/qq_35608277/article/details/79212700 ----------------------------------- ...

  4. sharpkeys键盘按键重映射

    /********************************************************************** * sharpkeys键盘按键重映射 * 说明: * 键 ...

  5. pip install GitHub package

    /********************************************************************************* * pip install Git ...

  6. Vue.js学习使用心得(二)——自定义指令

    自定义指令 除了核心功能默认内置的指令,Vue 也允许注册自定义指令. 自定义指令可以定义全局指令,也可以定义局部指令. 使用 directives 选项来自定义指令. 定义全局指令: <div ...

  7. django ---forms组件

    forms组件 本文目录 1 校验字段功能 2 渲染标签功能 3 渲染错误信息功能 4 组件的参数配置 5 局部钩子 6 全局钩子 回到目录 1 校验字段功能 针对一个实例:注册用户讲解. 模型:mo ...

  8. (0)前端总结(HTML + CSS + JQ)

    HTML 1.<meta charset="UTF-8">  #设置页面编码,这个设置英文则现在国内浏览器会弹出是否要转换中文 2.<title>我的第一个 ...

  9. C++学习(十七)(C语言部分)之 指针

    复习 数组定义格式 类型 数组名[数组大小]数组名+下标 int arr[2][3]={{1,2,3},{4,5,6}}; int arr[][3]={1,2,3,4,5,6};//二维数组定义的时候 ...

  10. [zoj4045][思维+dfs]

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4045 题意:给一棵树.这棵树有n个节点,问你这个图能不能分成k个分块.这个 ...