javascript - Making a div fixed at the top of the page -
i have div want move such stuck top of page. let's cannot use position: fixed;
i used $(document).scroll(function(){})
move div scrolling. makes site extremely slow after 10 seconds of scrolling.
my current solution use settimeout()
prevent multiple calls. however, causes delay, , div sticks top of page once have stopped scrolling.
is there way continuous smooth moving of div without killing speed?
edit: have following code:
<div id="outerdiv"> <div class="div"> <div class="fixed"></div> <div class="otherdivs"></div> </div> <div class="div"> <div class="fixed"></div> <div class="otherdivs"></div> </div> </div>
so .outerdiv has fixed width, , there many .div, such outerdiv has overflow-x: scroll
. if use position: fixed
on .fixed, not show properly. want each .div column, heading of each column move down
how using 2 different div
s. 1 containing fixed
content, , 1 containing content should scrollable?
so don't scroll within document within second div
?
or... use position:fixed
Comments
Post a Comment