From 059d888aaa67c4b4dabf0e48dbb48f8dabf76724 Mon Sep 17 00:00:00 2001 From: Omphalosskeptic Date: Tue, 28 Oct 2014 14:26:07 -0700 Subject: [PATCH] Added support for a cross-browser, accessible, responsive menu modal with a clean SVG hamburger icon! Fixes #6 --- assets/js/index.js | 11 +++++------ partials/menu.hbs | 34 ++++------------------------------ 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index e9fa9a3..3c7a64d 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -1,13 +1,12 @@ /** * Main JS file for Casper behaviours - */ +*/ /*globals jQuery, document */ (function ($) { "use strict"; $(document).ready(function(){ - $(".post-content").fitVids(); function casperFullImg() { @@ -55,7 +54,7 @@ timeout = setTimeout(delayed, threshold || 100); }; } - // smartresize + // smartresize jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; })(jQuery,'smartresize'); @@ -71,10 +70,10 @@ }; var options = $.extend(defaults, options); - options.elem.click(function(event){ + options.elem.click(function(event){ event.preventDefault(); var offset = ($(this).attr('data-offset')) ? $(this).attr('data-offset') : false, - position = ($(this).attr('data-position')) ? $(this).attr('data-position') : false; + position = ($(this).attr('data-position')) ? $(this).attr('data-position') : false; if (offset) { var toMove = parseInt(offset); $('html,body').stop(true, false).animate({scrollTop: ($(this.hash).offset().top + toMove) }, options.speed); @@ -87,4 +86,4 @@ }); }; -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/partials/menu.hbs b/partials/menu.hbs index 29f99f7..d66adf7 100644 --- a/partials/menu.hbs +++ b/partials/menu.hbs @@ -1,7 +1,5 @@