|
-
Sep 26th, 2005, 10:29 AM
#1
Thread Starter
Member
Floating Button
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
-
Oct 7th, 2005, 12:35 PM
#2
Member
Re: Floating Button
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>
-
Oct 11th, 2005, 11:34 AM
#3
Thread Starter
Member
Re: Floating Button
hey cfisher,
thanks so much for the code!
-
Oct 11th, 2005, 11:45 AM
#4
Member
Re: Floating Button
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
-
Oct 11th, 2005, 02:12 PM
#5
Thread Starter
Member
Re: Floating Button
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|