I have a menu which I need to scroll back to top when links are clicked. I have this code.
$('a').click(function(){
$('.positionHelper').scrollTo( {top:'-800px', left:'0'}, 0 );
});
the code works when just the handler function is run in firebug console, but when I attach the click to a selector it does not work. The only exception is when I attached it to $(‘html’).click. I, fired
I tested this with many different selectors and none work.
If your html is generated dynically (after page load) you need to use the
.livemethod. Your code would be: