javascript - Position fixed to the body come back to the top -


i want fix body there automatically scroll top of document , can't return was.

do know how can scroll in fixed body ?

this plunker : http://plnkr.co/edit/ubdtxtlx1mdl35tu6xyw?p=preview

with code jquery :

var topbody = $(window).scrolltop(); $("body").css("position","fixed"); $('html, body').animate( { scrolltop: topbody }, 0 ); 

are looking this: plunker?

jquery code:

$(function() {    function fixedthebody() {     var position = window.pageyoffset;     $(".sample").css({       "position": "fixed",       "height": "100%",       "overflow-x": "hidden"     }).animate({       scrolltop: position     }, 0);   }    button.onclick = fixedthebody;  }); 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -