perfect-scrollbar/examples/custom-theme.html

39 lines
1.1 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>perfect-scrollbar example</title>
<link href="custom-theme.css" rel="stylesheet">
<script src="../dist/js/perfect-scrollbar.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; }
</style>
</head>
<body>
2016-10-18 14:45:19 +08:00
<div id="container" class="contentHolder">
<div class="content">
</div>
</div>
2016-10-18 14:45:19 +08:00
<p style='text-align: center'>
<button id='default'>default</button>
<button id='custom'>custom</button>
</p>
<script>
var $ = document.querySelector.bind(document);
2016-10-18 14:45:19 +08:00
var container = $('#container');
window.onload = function () {
2016-10-18 14:45:19 +08:00
Ps.initialize(container, { theme: 'square' });
};
2016-10-18 14:45:19 +08:00
$('#default').addEventListener('click', function () {
Ps.destroy(container);
Ps.initialize(container);
});
$('#custom').addEventListener('click', function () {
Ps.destroy(container);
Ps.initialize(container, { theme: 'square' });
});
</script>
</body>
</html>