Add example to change theme

This commit is contained in:
Hyunje Jun 2016-10-18 15:45:19 +09:00
parent 69e3fb2688
commit c7ddde69c2

View File

@ -11,17 +11,28 @@
</style> </style>
</head> </head>
<body> <body>
<div id="Default" class="contentHolder"> <div id="container" class="contentHolder">
<div class="content"> <div class="content">
</div> </div>
</div> </div>
<p style='text-align: center'>
<button id='default'>default</button>
<button id='custom'>custom</button>
</p>
<script> <script>
var $ = document.querySelector.bind(document); var $ = document.querySelector.bind(document);
var container = $('#container');
window.onload = function () { window.onload = function () {
Ps.initialize($('#Default'), { Ps.initialize(container, { theme: 'square' });
theme: 'square'
});
}; };
$('#default').addEventListener('click', function () {
Ps.destroy(container);
Ps.initialize(container);
});
$('#custom').addEventListener('click', function () {
Ps.destroy(container);
Ps.initialize(container, { theme: 'square' });
});
</script> </script>
</body> </body>
</html> </html>