Sha256: afc5485e86b359a7f33220a536c470a32bab1fa8351c02968d098e4e0e74a605
Contents?: true
Size: 1.72 KB
Versions: 18
Compression:
Stored size: 1.72 KB
Contents
;(function (window, document, $) { // Set the negative margin on the top menu for slide-menu pages var $selector1 = $('#topMenu'), events = 'click.fndtn'; if ($selector1.length > 0) $selector1.css("margin-top", $selector1.height() * -1); // Watch for clicks to show the sidebar var $selector2 = $('#sidebarButton'); if ($selector2.length > 0) { $('#sidebarButton').on(events, function (e) { e.preventDefault(); $('body').toggleClass('active'); }); } // Watch for clicks to show the menu for slide-menu pages var $selector3 = $('#menuButton'); if ($selector3.length > 0) { $('#menuButton').on(events, function (e) { e.preventDefault(); $('body').toggleClass('active-menu'); }); } // // Adjust sidebars and sizes when resized // $(window).resize(function() { // // if (!navigator.userAgent.match(/Android/i)) $('body').removeClass('active'); // var $selector4 = $('#topMenu'); // if ($selector4.length > 0) $selector4.css("margin-top", $selector4.height() * -1); // }); // Switch panels for the paneled nav on mobile var $selector5 = $('#switchPanels'); if ($selector5.length > 0) { $('#switchPanels dd').on(events, function (e) { e.preventDefault(); var switchToPanel = $(this).children('a').attr('href'), switchToIndex = $(switchToPanel).index(); $(this).toggleClass('active').siblings().removeClass('active'); $(switchToPanel).parent().css("left", (switchToIndex * (-100) + '%')); }); } $('#nav li a').on(events, function (e) { e.preventDefault(); var href = $(this).attr('href'), $target = $(href); $('html, body').animate({scrollTop : $target.offset().top}, 300); }); }(this, document, jQuery));
Version data entries
18 entries across 18 versions & 2 rubygems