javascript - MooTools Fx.SmoothScroll() at min-screen width only -


is there simple way initialize fx.smoothscroll @ minimum screen width, , disable below?

ex, want smooth scroll happen above 400px.

why, because show/hide responsive menu messing scroll target position, js scrolling past target.

update: thought better measure offset of transitioning element, , set in smooth scroll. tried this, not working.

            $$('#nav ul li a.menu')[0].addevent('click', function(){                 window.offset = $('nav').getsize().y - 32;                 console.log(window.offset)             });             new fx.smoothscroll({                 offset: {                     y: -window.offset                 }             }); 

how update offset on each click?

after going proper "responsive" route, came code.

            var thescroll = new fx.scroll(window);             $$('#nav ul li a.menu')[0].addevent('click', function(e){                 e.preventdefault();                 offset = $('nav').getsize().y - 32;                 thescroll.options.offset.y = -offset;                 thescroll.toelement($('menu'),'y');             }); 

Comments