Hi,
I am working with ASP.NET in VB.NET and I wanted, in my webpage, a button, that always stays at the bottom of the page. If the user scrolls down, the button should move down to the bottom.
Is there anyway I can do that?
Thanks :)
Printable View
Hi,
I am working with ASP.NET in VB.NET and I wanted, in my webpage, a button, that always stays at the bottom of the page. If the user scrolls down, the button should move down to the bottom.
Is there anyway I can do that?
Thanks :)
Below is the code I use to have a floating table stay in the visible window as the users scroll.
Will cause the control specified to always stay at the top of a window when the user scroll down the page
In the HEAD section of the page add:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
window.onscroll = floatButton;
function floatButton () {
document.all.tblLegend.style.pixelTop = document.body.scrollTop;
}
function initLegend () {
document.all.tblLegend.style.pixelLeft = 500;
document.all.tblLegend.style.visibility = 'visible';
}
// End -->
</SCRIPT>
Add onLoad="initLegend()" to the BODY line of the page
(<body MS_POSITIONING="GridLayout" onLoad="initLegend()">)
Add the TABLE to the page
<TABLE ID="tblLegend" STYLE="Z-INDEX: 101; VISIBILITY: hidden; POSITION: absolute; TOP: 0px">
<tr>
<td bgcolor="#006699"><font color="white" ><b>Field Legends</b></font>
</td>
</tr>
</TABLE>
hey cfisher,
thanks so much for the code! :D
:wave:
Your welcome. I found the basis for the code somewhere within this forum (I forget where so I can't give proper credit) and adjusted it to be easily transferrable between my different applications.
Chris :)
yea instead of using a table, i just used a button, and it works perfectly fine. I adjusted the left positioning:
document.all.tblLegend.style.pixelLeft = document.body.scrollLeft;
So that it's always on the corner of the page no matter where you scroll.
everything seems to work well :)
thanks again :wave: