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

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -