|
|
(30 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | <html>
| |
− | <body>
| |
− | <!--- Scripts ---->
| |
− | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
| |
− | <script src="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
| |
− |
| |
− | <!-- jQuery -->
| |
− | <script>
| |
− | $(document).ready(function(){
| |
− | $('#sidebar-btn').click(function(){
| |
− | $('#sidebar').toggleClass('visible');
| |
− | $('#overlay').toggleClass('active');
| |
− | $('#container').toggleClass('inactive');
| |
− | $('#sidebar-btn').toggleClass('inactive');
| |
− | });
| |
− | $('#overlay').click(function(){
| |
− | $('#sidebar').toggleClass('visible');
| |
− | $('#overlay').toggleClass('active');
| |
− | $('#container').toggleClass('inactive');
| |
− | $('#sidebar-btn').toggleClass('inactive');
| |
− | });
| |
− |
| |
− | $('#sidebar ul ul.sub').click(function(){
| |
− | $(this).children().toggleClass('active');
| |
− | });
| |
− | });
| |
− |
| |
− | $(function(){
| |
− | $( "#container" ).on( "swiperight", swipeHandler );
| |
− | $( "#overlay" ).on( "swipeleft", swipeHandler );
| |
− | function swipeHandler( event ){
| |
− | $('#sidebar').toggleClass('visible');
| |
− | $('#overlay').toggleClass('active');
| |
− | $('#container').toggleClass('inactive');
| |
− | $('#sidebar-btn').toggleClass('inactive');
| |
− | }
| |
− | });
| |
− |
| |
− |
| |
− |
| |
− | </script>
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | <!-- w3 Accordion -->
| |
− | <script>
| |
− | var acc = document.getElementsByClassName("accordion");
| |
− | var i;
| |
| | | |
− | for (i = 0; i < acc.length; i++) {
| |
− | acc[i].onclick = function() {
| |
− | this.classList.toggle("active");
| |
− | var panel = this.nextElementSibling;
| |
− | if (panel.style.maxHeight){
| |
− | panel.style.maxHeight = null;
| |
− | } else {
| |
− | panel.style.maxHeight = panel.scrollHeight + "px";
| |
− | }
| |
− | }
| |
− | }
| |
− | </script>
| |
− | </body>
| |
− | </html>
| |