javascript - Responsive jQuery script load -


i have script fades in logo based on scroll position (based on daniel stuart's solution: http://danielstuart.ie/2010/09/20/my-jquery-mini-logo/ )

    <script>         var $scrolled = new boolean(false);         jquery.noconflict();         jquery(window).scroll(function () {             position = jquery(window).scrolltop();             if(position >=250 && $scrolled == false){                 $scrolled = new boolean(true);                 jquery('.small-logo').fadein('normal', function() { });             }else if(position <250 && $scrolled == true){                 $scrolled = new boolean(false);                 jquery('.small-logo').fadeout('normal', function() { });             }         });     </script> 

the issue site responsive , don't want load when browser width less 768px. how can make happen, or not happen were?

$(window).width() need:

jquery(window).scroll(function () {       if (jquery(window).width() > 768) {         position = jquery(window).scrolltop();         if(position >=250 && $scrolled == false){             $scrolled = new boolean(true);             jquery('.small-logo').fadein('normal', function() { });         }else if(position <250 && $scrolled == true){             $scrolled = new boolean(false);             jquery('.small-logo').fadeout('normal', function() { });         }       }     }); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -