perfect-scrollbar
=================
Tiny but perfect jQuery scrollbar plugin
Why perfect-scrollbar?
------------------
I worked on a personal project recently, and I was trying to find the jQuery scrollbar plugin that's *perfect*. But there was no *perfect* scrollbar plugin. That's why I decided to make one.
perfect-scrollbar is very tiny but *perfect* (for me, and maybe for the most of developers) jQuery scrollbar plugin.
I hope you love this!
Demo: http://noraesae.github.com/perfect-scrollbar/
What does *perfect* mean?
---------------------
*perfect* means...
* There should be no css change on any original element.
* The scrollbar should not affect the original design layout.
* The design of the scrollbar should be (nearly) fully customizable.
* If the size of the container or the content changes, the scrollbar size and position should be able to change.
Then perfect-scrollbar is really *perfect*?
-------------------------------------------
Yes! the only thing that's not *perfect* is my English.
* perfect-scrollbar has some requirements, but doesn't change or add any style on original elements.
* perfect-scrollbar is designed not to have width or height. It's fixed on the right and bottom side of the container.
* You can change nearly all css styles of the scrollbar. The scrollbar design has no dependency on scripts.
* perfect-scrollbar support 'update' function. Whenever you need to update the size or position of the scrollbar, just update.
* Additionally, perfect-scrollbar do use 'scrollTop' and 'scrollLeft', not absolute position or something messy.
It's cool, isn't it?
Install
-------
You can download the latest stable version with download links in [Github Page](http://noraesae.github.io/perfect-scrollbar/). You also can find all releases in [Releases](https://github.com/noraesae/perfect-scrollbar/releases) page.
If you want to use the development version of the plugin, use the source files which are not minified. They're in the `src` directory. The development version may be unstable, but some known bugs can be fixed.
```
git clone https://github.com/noraesae/perfect-scrollbar.git
cd perfect-scrollbar/src
```
You can use [Bower](http://bower.io/) to install the plugin. The plugin is registered as `perfect-scrollbar`.
```
bower install perfect-scrollbar
```
Requirements
------------
To make this plugin *perfect*, some requirements were not avoidable. But they're all very trivial and there's nothing to worry about.
* the container must have a 'position' css style.
* the container must have an 'overflow:hidden' css style.
* the scrollbar's position must be 'absolute'.
* the scrollbar-x must have a 'bottom' css style, and the scrollbar-y must have a 'right' css style.
The requirement below is for perfect-scrollbar <= 0.3.4
* there must be the *one* content element(like div) for the container.
Optional parameters
-------------------
perfect-scrollbar supports optional parameters.
### wheelSpeed
The scroll speed applied to mousewheel event.
**Default: 10**
### wheelPropagation
If this option is true, when the scroll reach the end of the side, mousewheel event will be propagated to parent element.
**Default: false**
### minScrollbarLength
When set to an integer value, the thumb part of the scrollbar will not shrink below that number of pixels.
**Default: null**
### useBothWheelAxes
When set to true, and only one (vertical or horizontal) scrollbar is visible then both vertical and horizontal scrolling will affect the scrollbar.
**Default: false**
### useKeyboard
When set to true, the scroll works with arrow keys on the keyboard. The element is scrolled only when the mouse cursor hovers the element.
**Default: true**
### suppressScrollX
When set to true, the scroll bar in X axis will not be available, regardless of the content width.
**Default: false**
### suppressScrollY
When set to true, the scroll bar in Y axis will not be available, regardless of the content height.
**Default: false**
### scrollXMarginOffset
The number of pixels the content width can surpass the container width without enabling the X axis scroll bar. Allows some "wiggle room" or "offset break", so that X axis scroll bar is not enabled just because of a few pixels.
**Default: 0**
### scrollYMarginOffset
The number of pixels the content height can surpass the container height without enabling the Y axis scroll bar. Allows some "wiggle room" or "offset break", so that Y axis scroll bar is not enabled just because of a few pixels.
**Default: 0**
### includePadding
When set to true, it uses `innerWidth` and `innerHeight` for the container size instead of `width` and `height`. When your container element has non-zero padding and the scrollbar layout looks weird, this option can be helpful.
**Default: false**
How to Use
----------
```html
<style>
#Demo { position: 'relative'; }
</style>
<div id='Demo'>
<div>
...
</div>
</div>
```
When the html document is like above, just use like this:
```javascript
$('#Demo').perfectScrollbar();
```
With optional parameters:
```javascript
$("#Demo").perfectScrollbar({
wheelSpeed: 20,
wheelPropagation: true,
minScrollbarLength: 20
})
```
If the size of your container or content changes:
```javascript
$('#Demo').perfectScrollbar('update');
```
If you want to destory the scrollbar:
```javascript
$('#Demo').perfectScrollbar('destroy');
```
If you want to scroll to somewhere, just use scroll-top css and update.
```javascript
$("#Demo").scrollTop(0);
$("#Demo").perfectScrollbar('update');
```
Also you can get the informations about how to use the plugin from example codes in the `examples` directory of the source tree.
Very helpful friends
--------------------
perfect-scrollbar supports [jquery-mousewheel](https://github.com/brandonaaron/jquery-mousewheel). If you want to use mousewheel features, please include jquery-mousewheel before using perfect-scrollbar.
If you want to make this plugin's update function more responsive, [jquery-resize](https://github.com/cowboy/jquery-resize) can be helpful.
Contribution
------------
#### Please read [Contributing](https://github.com/noraesae/perfect-scrollbar/wiki/Contributing) in the wiki before making any contibution.
I *really* welcome contributions! Please feel free to fork and issue pull requests when...
* You have a very nice idea to improve this plugin!
* You found a bug!
* You're good at English and can help my bad English!
For IE problems, please refer to [IE Support](https://github.com/noraesae/perfect-scrollbar#ie-support)
IE Support
----------
This plugin supports old IE browsers in the **minimum** range. The plugin is tested in IEs >= IE6 and works(not well, but works).
**But the project will not accept the patches to fix IE problems in IE 6/7/8.**
From jQuery 2.0, jQuery also will not support IE 6/7/8. I also think that supporting old browsers really breaks the web development conventions.
When old IEs should be supported, please fork the project and make patches personally.
Helpdesk
--------
If you have any idea to improve this project or any problem using this, please feel free to upload an [issue](https://github.com/noraesae/perfect-scrollbar/issues).
License
-------
The MIT License (MIT) Copyright (c) 2012, 2014 Hyeonje Alex Jun and other contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
e- mobile 6.5 组件安装包 (1237个子文件)
MobileService.class 103KB
ManagerAction.class 56KB
MobileManager.class 56KB
ClientAction.class 35KB
PluginService.class 29KB
MainAction.class 22KB
MobilePluginLoader.class 14KB
LicenseManager.class 11KB
InstallAction.class 10KB
MobileUtil.class 8KB
PushAction.class 8KB
AttendanceService.class 7KB
DatabaseUtil.class 6KB
WeaverRongUtil.class 6KB
PushNotificationService.class 6KB
MD5.class 6KB
WeaverOpenfireUtil.class 5KB
XssFilter.class 5KB
HttpUtil.class 5KB
MobileUser.class 4KB
MobileSyncManager.class 4KB
DialogHandleFilter.class 4KB
ApiHttpClient.class 4KB
PluginService$CustomFilePart.class 3KB
HttpUtil.class 3KB
ApiHttpClient.class 3KB
ClientInfo.class 3KB
WeixinAction.class 3KB
CacheUtil.class 3KB
EasySSLProtocolSocketFactory.class 3KB
WCacheFilter.class 3KB
XssHttpServletRequestWrapper.class 3KB
MobileModule.class 3KB
MobileClient.class 2KB
Encoder.class 2KB
WGzipStream.class 2KB
ImageUtil.class 2KB
SpringContextHolder.class 2KB
MobilePlugin.class 2KB
License.class 2KB
EasyX509TrustManager.class 2KB
WGzipFilter.class 2KB
GB2Alpha.class 2KB
DatabaseListener.class 2KB
Upgrade025.class 2KB
MobileComponent.class 2KB
WGzipFilter$Wrapper.class 2KB
MobileService$1.class 2KB
GZIPResponseStream.class 2KB
WStaticFilter.class 2KB
MobileVersion.class 2KB
MobileOffineMsgExpiresJob.class 2KB
MobileOnlineStatisticsJob.class 2KB
MobileUserAuth.class 2KB
GZIPResponseWrapper.class 2KB
MobileUserSafety.class 1KB
UuidUtils.class 1KB
ManagerInterceptor.class 1KB
MobileNavigation.class 1KB
MobileModulePermission.class 1KB
DialogResponseWrapper.class 1KB
MobileInterceptor.class 1KB
MobileUserUpload.class 1KB
WCacheFilter$WCacheHttpResponseWrapper.class 1KB
MobilePluginUser.class 1KB
GZIPFilter.class 1KB
MobilePushDevice.class 1KB
MobilePluginDesign.class 1KB
MobileSyncJob.class 1KB
FileComparator.class 1KB
AttendancePoint.class 1KB
FormatType.class 1KB
StringUtil.class 1016B
FormatType.class 1016B
MobileAttribute.class 1003B
PluginService$CustomStringPart.class 980B
MobileFunction.class 976B
LicenseManager$1.class 969B
MobileQuickNew.class 969B
MobileModuleGroup.class 915B
WeaverStringUtil.class 878B
MobileMessageType.class 855B
CodeUtil.class 841B
CodeUtil.class 838B
IECompatibleFilter.class 792B
MobileUserGroup.class 790B
MobileSetting.class 776B
MobileUserConfig.class 770B
MobileMessageCount.class 761B
MobileService$2.class 751B
MobileFilter.class 750B
TxtMessage.class 742B
WGzipFilter$Wrapper$WrappedOutputStream.class 742B
TxtMessage.class 730B
CmdNtf.class 672B
MobileListener.class 670B
PropNotMatchPluginFile.class 665B
PluginService$1.class 663B
Test.class 643B
SdkHttpResult.class 639B
共 1237 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
dilacxnoa
- 粉丝: 4
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
- 基于Java和LCN分布式事务框架的设计源码 - tx-lcn
- 基于Java和JavaScript的茶叶评级管理系统设计源码 - tea
- IMG_5680.JPG
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功