Page MenuHomeWolfplex

off-canvas.js
No OneTemporary

off-canvas.js

$(function() {
// Set the negative margin on the top menu for slide-menu pages
var $selector1 = $('#menu-top-nav'),
events = 'click.fndtn touchstart.fndtn';
//if ($selector1.length > 0) $selector1.css("margin-top", $selector1.height() * -1);
// Watch for clicks to show the sidebar
var $selector2 = $('#mobile-nav-button');
if ($selector2.length > 0) {
$('#mobile-nav-button').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() {
$('body').removeClass('active');
var $selector4 = $('#menu-top-nav');
//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);
});
});

File Metadata

Mime Type
text/plain
Expires
Tue, Jun 10, 10:44 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63404
Default Alt Text
off-canvas.js (1 KB)

Event Timeline