jquery - How can I tell javascript to execute after max-width -
i want execute below javascript if width set 600px or above. how can put max-width condition?
$(function() { $('#nav li a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top }, 1500,'easeinoutexpo'); event.preventdefault(); }); });
if viewport width, you'd inside click callback.
if ($(window).width() < 600) { return; }
Comments
Post a Comment