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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -