jQuery(document).ready(function($){ $.fn.swipeNav = function(options) { var options = $.extend( { menu : this, menuBtn : $('#menuBtn'), body : $(document.body), menuSpeed : 300, }, options); var menuWidth = options.menu.width(); $(document.body).css({ 'overflow-x' : 'hidden', 'position': 'static', 'left' : 0, }); options.menu.css({ 'position' : 'fixed', 'top' : 0, 'left': - menuWidth + 'px', 'width': + menuWidth + 'px', 'height' : 100 + '%', }); options.menuBtn.on('click',function(){ options.body.toggleClass('open'); if(options.body.hasClass('open')){ options.body.animate({'left' : menuWidth }, options.menuSpeed); options.menu.animate({'left' : 0 }, options.menuSpeed); } else { options.menu.animate({'left' : -menuWidth }, options.menuSpeed); options.body.animate({'left' : 0 }, options.menuSpeed); } }); } }); jQuery(document).ready(function($){ //Google Font WebFontConfig = { google: { families: [ 'Raleway::latin' ] } }; (function() { var wf = document.createElement('script'); wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(wf, s); })(); //Page Action $(document).on('click','#swipeNav li a',function(){ var href= $(this).attr("href"); switch(href){ case '#license': $('#main').load('license.html'); return false; break; case '#src': $('#main').load('src.html'); return false; break; } }); //jQueryPlug-in Slide-Nav $('#swipeNav').swipeNav(); });