|
@@ -44,25 +44,21 @@
|
|
|
</style>
|
|
|
|
|
|
<script src="js/jquery.min.js"></script>
|
|
|
-<script src="../jquery.nicescroll.js"></script>
|
|
|
+<script src="js/jquery.nicescroll.min.js"></script>
|
|
|
|
|
|
<script>
|
|
|
$(document).ready(function() {
|
|
|
- var nice = $("html").niceScroll();
|
|
|
- $("#div1").html($("#div1").html()+' '+nice.version);
|
|
|
-
|
|
|
- var toggleScroll = function () {
|
|
|
- if (nice) {
|
|
|
- nice.remove();
|
|
|
- nice = null;
|
|
|
- } else {
|
|
|
- nice = $("html").niceScroll(); // The document page (body)
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
+
|
|
|
+ var nice = $("html").niceScroll(); // The document page (body)
|
|
|
+
|
|
|
+ $("#div1").html($("#div1").html()+' '+nice.version);
|
|
|
+
|
|
|
+ $("#boxscroll").niceScroll({cursorborder:"",cursorcolor:"#00F",boxzoom:true}); // First scrollable DIV
|
|
|
|
|
|
- $('button').on('click',toggleScroll);
|
|
|
+ $("#boxscroll2").niceScroll("#contentscroll2",{cursorcolor:"#F00",cursoropacitymax:0.7,boxzoom:true,touchbehavior:true}); // Second scrollable DIV
|
|
|
+ $("#boxframe").niceScroll("#boxscroll3",{cursorcolor:"#0F0",cursoropacitymax:0.7,boxzoom:true,touchbehavior:true}); // This is an IFrame (iPad compatible)
|
|
|
|
|
|
+ $("#boxscroll4").niceScroll("#boxscroll4 .wrapper",{boxzoom:true}); // hw acceleration enabled when using wrapper
|
|
|
|
|
|
});
|
|
|
</script>
|
|
@@ -72,7 +68,7 @@
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
-<button>Toggle scroll</button>
|
|
|
+
|
|
|
<div id="div1"><strong>NiceScroll version:</strong></div>
|
|
|
|
|
|
<div id="boxscroll">
|