Rewrite examples with a native JavaScript version.

This commit is contained in:
Hyunje Alex Jun 2015-01-26 16:32:33 +00:00
parent 89c3bdb1cf
commit 48eb80bd7f
16 changed files with 294 additions and 269 deletions

View File

@ -1,11 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
h1 { text-align: center; } h1 { text-align: center; }
.container { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .container { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
@ -18,12 +17,6 @@
opacity: 0.6; opacity: 0.6;
} }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('.container').perfectScrollbar();
});
</script>
</head> </head>
<body> <body>
<h1>Default</h1> <h1>Default</h1>
@ -37,5 +30,12 @@
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
window.onload = function () {
[].forEach.call(document.querySelectorAll('.container'), function (el) {
Ps.initialize(el);
});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<style> <style>

View File

@ -1,27 +1,22 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
#iframe { width: 100%; min-height: 450px; border: 0; } #iframe { width: 100%; min-height: 450px; border: 0; }
html { direction: rtl; } html { direction: rtl; }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#iframe').load(function() {
var contentIframe = $(this).contents();
var documentIframe = contentIframe.get(0);
$('#Default', documentIframe).perfectScrollbar();
});
});
</script>
</head> </head>
<body> <body>
<iframe src="iframe-content.html" id="iframe"></iframe> <iframe src="iframe-content.html" id="iframe"></iframe>
<script>
var iframe = document.querySelector('#iframe');
iframe.onload = function () {
Ps.initialize(iframe.contentDocument.querySelector('#Default'))
};
</script>
</body> </body>
</html> </html>

40
examples/jquery.html Normal file
View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="../out/js/perfect-scrollbar.jquery.js"></script>
<style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
.spacer { text-align:center }
</style>
</head>
<body>
<h1 style="text-align:center">Default; wheelSpeed:1</h1>
<div id="Default" class="contentHolder">
<div class="content">
</div>
</div>
<h1 style="text-align:center">Fast: wheelSpeed:10</h1>
<div id="FastWheelSpeed" class="contentHolder">
<div class="content">
</div>
</div>
<h1 style="text-align:center">Slow: wheelSpeed:0.1</h1>
<div id="SlowWheelSpeed" class="contentHolder">
<div class="content">
</div>
</div>
<script>
$(document).ready(function ($) {
$('#Default').perfectScrollbar();
$('#FastWheelSpeed').perfectScrollbar({wheelSpeed: 10});
$('#SlowWheelSpeed').perfectScrollbar({wheelSpeed: 0.1});
});
</script>
</body>
</html>

View File

@ -1,27 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
.spacer { text-align:center } .spacer { text-align:center }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
});
var updateSize = function () {
var width = parseInt($('#width').val(), 10);
var height = parseInt($('#height').val(), 10);
$('#Default').width(width).height(height).perfectScrollbar('update');
};
</script>
</head> </head>
<body> <body>
<div id="Default" class="contentHolder"> <div id="Default" class="contentHolder">
@ -33,6 +21,20 @@
Height <input type='text' id='height' value='400'> Height <input type='text' id='height' value='400'>
<button onclick='updateSize()'>Change!</button> <button onclick='updateSize()'>Change!</button>
</p> </p>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
};
var updateSize = function () {
var width = parseInt($('#width').value, 10);
var height = parseInt($('#height').value, 10);
var container = $('#Default');
container.style.width = width + 'px';
container.style.height = height + 'px';
Ps.update(document.querySelector('#Default'));
};
</script>
</body> </body>
</html> </html>

View File

@ -1,23 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 640px; height: 360px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 640px; height: 360px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 12800px; height: 7200px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 12800px; height: 7200px; }
.spacer { text-align:center } .spacer { text-align:center }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
$('#LongThumb').perfectScrollbar({minScrollbarLength:100});
});
</script>
</head> </head>
<body> <body>
<h1 style="text-align:center">No minimum</h1> <h1 style="text-align:center">No minimum</h1>
@ -30,5 +22,12 @@
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
Ps.initialize($('#LongThumb'), {minScrollbarLength: 100});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,25 +1,16 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
.spacer { text-align:center } .spacer { text-align:center }
h2 { text-align: center; } h2 { text-align: center; }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
$('#SuppressScrollX').perfectScrollbar({suppressScrollX: true});
$('#SuppressScrollY').perfectScrollbar({suppressScrollY: true});
});
</script>
</head> </head>
<body> <body>
<h2>Default</h2> <h2>Default</h2>
@ -37,6 +28,13 @@
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
Ps.initialize($('#SuppressScrollX'), {suppressScrollX: true});
Ps.initialize($('#SuppressScrollY'), {suppressScrollY: true});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,25 +1,16 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 640px; height: 360px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 640px; height: 360px; overflow: hidden; }
.contentHolder .content-x { background-image: url('./azusa.jpg'); width: 1920px; height: 360px; } .contentHolder .content-x { background-image: url('./azusa.jpg'); width: 1920px; height: 360px; }
.contentHolder .content-y { background-image: url('./azusa.jpg'); width: 640px; height: 1080px; } .contentHolder .content-y { background-image: url('./azusa.jpg'); width: 640px; height: 1080px; }
.spacer { text-align:center; } .spacer { text-align:center; }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
$('#CanScrollWithYAxis').perfectScrollbar({useBothWheelAxes: true});
$('#CanScrollWithXAxis').perfectScrollbar({useBothWheelAxes: true});
});
</script>
</head> </head>
<body> <body>
<h1 style="text-align:center">Default.</h1> <h1 style="text-align:center">Default.</h1>
@ -37,5 +28,13 @@
<div class="content-y"> <div class="content-y">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
Ps.initialize($('#CanScrollWithYAxis'), {useBothWheelAxes: true});
Ps.initialize($('#CanScrollWithXAxis'), {useBothWheelAxes: true});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,23 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
.spacer { text-align:center } .spacer { text-align:center }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
$('#NoWheelPropagation').perfectScrollbar({wheelPropagation:true});
});
</script>
</head> </head>
<body> <body>
<h1 style="text-align:center">Default; wheelPropagation:false</h1> <h1 style="text-align:center">Default; wheelPropagation:false</h1>
@ -26,7 +18,7 @@
</div> </div>
</div> </div>
<h1 style="text-align:center">wheelPropagation:true</h1> <h1 style="text-align:center">wheelPropagation:true</h1>
<div id="NoWheelPropagation" class="contentHolder"> <div id="WheelPropagation" class="contentHolder">
<div class="content"> <div class="content">
</div> </div>
</div> </div>
@ -34,6 +26,13 @@
Note<br>that<br>there<br>is<br>plenty<br>of<br>text<br>after<br>the<br>image<br>to<br>ensure<br>that<br>it<br>is<br>possible<br>to<br>down<br> Note<br>that<br>there<br>is<br>plenty<br>of<br>text<br>after<br>the<br>image<br>to<br>ensure<br>that<br>it<br>is<br>possible<br>to<br>down<br>
after<br>the<br>bottom<br>of<br>the<br>image<br>has<br>been<br>reached<br>to<br>enable<br>the<br>wheel<br>propagation<br>to<br>be<br>tested<br> after<br>the<br>bottom<br>of<br>the<br>image<br>has<br>been<br>reached<br>to<br>enable<br>the<br>wheel<br>propagation<br>to<br>be<br>tested<br>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
Ps.initialize($('#WheelPropagation'), {wheelPropagation: true});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,24 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
.spacer { text-align:center } .spacer { text-align:center }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
$('#FastWheelSpeed').perfectScrollbar({wheelSpeed:10});
$('#SlowWheelSpeed').perfectScrollbar({wheelSpeed:0.1});
});
</script>
</head> </head>
<body> <body>
<h1 style="text-align:center">Default; wheelSpeed:1</h1> <h1 style="text-align:center">Default; wheelSpeed:1</h1>
@ -36,6 +27,14 @@
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
Ps.initialize($('#FastWheelSpeed'), {wheelSpeed: 10});
Ps.initialize($('#SlowWheelSpeed'), {wheelSpeed: 0.1});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,12 +1,10 @@
<!DOCTYPE HTML> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
#description { #description {
border: 1px solid gray; border: 1px solid gray;
@ -15,27 +13,8 @@
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
#status { #status { color: red; }
color: red;
}
</style> </style>
<script type="text/javascript">
$(document).ready(function ($) {
var $container = $('#description');
var $status = $('#status');
$container.perfectScrollbar();
$container.scroll(function(e) {
if($container.scrollTop() === 0) {
$status.text('it reaches the top!');
}
else if ($container.scrollTop() === $container.prop('scrollHeight') - $container.height()) {
$status.text('it reaches the end!');
} else {
$status.text('');
}
});
});
</script>
</head> </head>
<body> <body>
<div id="description" class="wrapper"> <div id="description" class="wrapper">
@ -52,5 +31,23 @@
</div> </div>
<div id="status"> <div id="status">
</div> </div>
<script type="text/javascript">
var $ = document.querySelector.bind(document);
window.onload = function () {
var container = $('#description');
var stat = $('#status');
Ps.initialize(container);
container.addEventListener('scroll', function (e) {
if(container.scrollTop === 0) {
stat.innerHTML = 'it reaches the top!';
}
else if (container.scrollTop === container.scrollHeight - container.clientHeight) {
stat.innerHTML = 'it reaches the end!';
} else {
stat.innerHTML = '';
}
});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,12 +1,10 @@
<!DOCTYPE HTML> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
#test { #test {
border: 1px solid gray; border: 1px solid gray;
@ -22,16 +20,6 @@
line-height: 44px; line-height: 44px;
} }
</style> </style>
<script type="text/javascript">
$(document).ready(function ($) {
var test = $('#test');
test.perfectScrollbar();
test.find('a').click(function () {
$(this).parent().remove();
test.perfectScrollbar('update');
});
});
</script>
</head> </head>
<body> <body>
<div id="test" class="wrapper"> <div id="test" class="wrapper">
@ -48,5 +36,18 @@
<div class='element'>Hello! Click <a href='#'>here</a> to remove this!</div> <div class='element'>Hello! Click <a href='#'>here</a> to remove this!</div>
<div class='element'>Hello! Click <a href='#'>here</a> to remove this!</div> <div class='element'>Hello! Click <a href='#'>here</a> to remove this!</div>
</div> </div>
<script type="text/javascript">
var $ = document.querySelector.bind(document);
window.onload = function () {
var test = $('#test');
Ps.initialize(test);
[].forEach.call(test.querySelectorAll('.element'), function (el) {
el.querySelector('a').addEventListener('click', function () {
el.parentNode.removeChild(el);
Ps.update(test);
});
});
};
</script>
</body> </body>
</html> </html>

View File

@ -1,11 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
@ -13,17 +12,17 @@
html { direction: rtl; } html { direction: rtl; }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
});
</script>
</head> </head>
<body> <body>
<div id="Default" class="contentHolder"> <div id="Default" class="contentHolder">
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
};
</script>
</body> </body>
</html> </html>

View File

@ -1,11 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
@ -22,17 +21,17 @@
right: auto; /* If using `left`, there shouldn't be a `right`. */ right: auto; /* If using `left`, there shouldn't be a `right`. */
} }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
});
</script>
</head> </head>
<body> <body>
<div id="Default" class="contentHolder"> <div id="Default" class="contentHolder">
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
};
</script>
</body> </body>
</html> </html>

View File

@ -1,11 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
.contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; } .contentHolder { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
.contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; } .contentHolder .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
@ -18,17 +17,17 @@
margin: 3px 0; margin: 3px 0;
} }
</style> </style>
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#Default').perfectScrollbar();
});
</script>
</head> </head>
<body> <body>
<div id="Default" class="contentHolder"> <div id="Default" class="contentHolder">
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#Default'));
};
</script>
</body> </body>
</html> </html>

View File

@ -1,12 +1,10 @@
<!DOCTYPE HTML> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title> <title>perfect-scrollbar example</title>
<link href="../out/css/perfect-scrollbar.css" rel="stylesheet"> <link href="../out/css/perfect-scrollbar.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="../out/js/perfect-scrollbar.global.js"></script>
<script src="../out/js/perfect-scrollbar.js"></script>
<style> <style>
#description { #description {
border: 1px solid gray; border: 1px solid gray;
@ -16,11 +14,6 @@
position: absolute; position: absolute;
} }
</style> </style>
<script type="text/javascript">
$(document).ready(function ($) {
$('#description').perfectScrollbar();
});
</script>
</head> </head>
<body> <body>
<div id="description" class="wrapper"> <div id="description" class="wrapper">
@ -37,5 +30,11 @@
<p>The command takes options applicable</p> <p>The command takes options applicable</p>
</div> </div>
</div> </div>
<script>
var $ = document.querySelector.bind(document);
window.onload = function () {
Ps.initialize($('#description'));
};
</script>
</body> </body>
</html> </html>