animate .scroll
animate .scroll
Why are not working?
- var tempScrollTop, currentScrollTop = 0;
- $(window).scroll(function(){
- currentScrollTop = $("html").offset().top;
- if (tempScrollTop < currentScrollTop)
- {
- $("html:not(:animated),body:not(:animated)").animate({scrollTop: margintop_html+120}, 500);
- }
- else if(tempScrollTop > currentScrollTop)
- {
- $("html:not(:animated),body:not(:animated)").animate({scrollTop: margintop_html-120}, 500);
- }
- tempScrollTop = currentScrollTop;
- });