Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Created August 8, 2015 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codigoconjuan/d9a082b8ec19825dccc1 to your computer and use it in GitHub Desktop.
Save codigoconjuan/d9a082b8ec19825dccc1 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($){
var breakpoint = 600;
var sf = $('ul.nav-menu');
if($(document).width() >= breakpoint){
sf.superfish({
delay: 200,
speed: 'fast'
});
}
$(window).resize(function(){
if($(document).width() >= breakpoint & !sf.hasClass('sf-js-enabled')){
sf.superfish({
delay: 200,
speed: 'fast'
});
} else if($(document).width() < breakpoint) {
sf.superfish('destroy');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment