nicescroll plugin for jquery - scrollbars like iphone/ipad
fork from : https://github.com/inuyaksa/jquery.nicescroll.git
|
11 年 前 | |
---|---|---|
demo | 11 年 前 | |
MIT.LICENSE | 12 年 前 | |
README.md | 11 年 前 | |
bower.json | 11 年 前 | |
changelog_3.5.4.txt | 11 年 前 | |
jquery.nicescroll.js | 11 年 前 | |
jquery.nicescroll.min.js | 11 年 前 | |
package.json | 11 年 前 | |
zoomico.png | 13 年 前 |
#jQuery.NiceScroll v. 3.5.4 11-13-2013
Nicescroll as a Greasemonkey plugin: http://userscripts.org/scripts/show/119910 (freezed)
Nicescroll is a jquery plugin, for nice scrollbars with a very similar ios/mobile style.
So you have scrollable divs with momentum for iPad 4+ and you have consistent scrollable areas for all desktop and mobile platforms.
Sexy zoom feature, you can "zoom-in" the content of any nicescroll'ed div. Nice to use and nice to see, all the content of the div in fullscreen mode. It works on desktop (double click on div) either in mobile/touch devices using pinch gesture.
On modern browsers hardware accelerated scrolling has implemented. Using animationFrame for a smoothest and cpu-saving scrolling. (when browser supports)
Warning for IE6 users (why do you uses IE6 yet? Please updgrade to a more stable and modern browser), some feature can't work for limitation of the browser. Document (body) scrollbars can't appears, old (native browser) one is used. Some issues with IFrame scrolling.
It's a plugin for the jquery framework, you need to include jquery in your scripts. From 1.5.x version and on. (you can try with 1.4.2+ also)
Copy image "zoomico.png" in the same folder of jquery.nicescroll.js.
Initialize nicescroll ALWAYS in (document) ready statement.
1. Simple mode, it styles document scrollbar:
$(document).ready(
function() {
$("html").niceScroll();
}
);
2. Instance with object returned:
var nice = false;
$(document).ready(
function() {
nice = $("html").niceScroll();
}
);
3. Style a DIV and chage cursor color:
$(document).ready(
function() {
$("#thisdiv").niceScroll({cursorcolor:"#00F"});
}
);
4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content:
$(document).ready(
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:
Scroll X Axis - $("#mydiv").getNiceScroll().doScrollLeft(x, duration);
Scroll Y Axis - $("#mydiv").getNiceScroll().doScrollTop(y, duration);
When you call "niceScroll" you can pass some parameters to custom visual aspects:
scriptpath, define custom path for boxmode icons (default:"" => same script path)
LICENSE
######Licensed under the MIT License, http://www.opensource.org/licenses/mit-license.php ######Images used for zoom icons have derived from OLPC interface, http://laptop.org/8.2.0/manual/Browse_ChangingView.html