mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-12 08:43:58 +02:00
19 lines
482 B
JavaScript
19 lines
482 B
JavaScript
(function ($) {
|
|
// Attach FastClick
|
|
var attachFastClick = Origami.fastclick;
|
|
attachFastClick(document.body);
|
|
|
|
// Mobile TOC menu
|
|
var $window = $(window),
|
|
$nav = $('.site-navigation');
|
|
$nav.click(function (e) {
|
|
var $target = $(e.target);
|
|
if ($target.is($nav) && $window.width() <= 375) {
|
|
$nav.toggleClass('open');
|
|
}
|
|
if ($target.is('a')) {
|
|
$nav.removeClass('open');
|
|
}
|
|
});
|
|
})(jQuery);
|