How to scroll a button on page scroll
I need to know how to scro开发者_Python百科ll a button on page scroll.
I have some 200 table data where I can select anyone of them, and then I can submit it to a database. The problem is, if I select the 1st row of table data I need to travel toward the bottom of the table to bring the submit button into view. I am planning to make the button scroll with the page, can anyone help me achieve this?
The better solution is make your table scrollable
put the whole data inside the <div>
and make it scrollable and put the submit button outside this div.
something like:-
<div style="height:500px;overflow:auto">
//All rows here
</div>
<input type="submit">
Thanks.
Use position: fixed
in your css:
#myButtonId {
position: fixed;
}
Didnt get your question right. Did you mean that the submit button should be stationary irrespective of the page scroll. if it's so, add 'position: absolute' style to the button and add 'top', 'left' values to the css.
Istead of using javascript or position:absolute css, consider adding one button/link to each row, called "Choose this row" or similar.
精彩评论