Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pinning down a table 1

Status
Not open for further replies.

ksoong

Programmer
Oct 3, 2000
57
CA
Hey guys,

is there a style attribute that i could attach to a table so that I can determine it's exact position and pin it there?
I'd like to pin a table to the bottom of top of the browser and keep it there even if the page scrolls. i know that i can use frames but i don't want to go there.

Thanks

Ken
 
<!-- THREE STEPS TO INSTALL LOGO BRANDING:

1. Insert the first code into the HEAD of your HTML document
2. Add the onLoad event handler to the BODY tag
3. the last code into the BODY of your HTML document -->

<!-- STEP ONE: Put this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Original: Randy Bennett (rbennett@thezone.net) -->
<!-- Web Site: http//home.thezone.net/~rbennett/utility/javahead.htm -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

<!-- Begin
function setVariables() {
imgwidth=235; // logo width, in pixels
imgheight=19; // logo height, in pixels
if (navigator.appName == &quot;Netscape&quot;) {
horz=&quot;.left&quot;;
vert=&quot;.top&quot;;
docStyle=&quot;document.&quot;;
styleDoc=&quot;&quot;;
innerW=&quot;window.innerWidth&quot;;
innerH=&quot;window.innerHeight&quot;;
offsetX=&quot;window.pageXOffset&quot;;
offsetY=&quot;window.pageYOffset&quot;;
}
else {
horz=&quot;.pixelLeft&quot;;
vert=&quot;.pixelTop&quot;;
docStyle=&quot;&quot;;
styleDoc=&quot;.style&quot;;
innerW=&quot;document.body.clientWidth&quot;;
innerH=&quot;document.body.clientHeight&quot;;
offsetX=&quot;document.body.scrollLeft&quot;;
offsetY=&quot;document.body.scrollTop&quot;;
}
}
function checkLocation() {
objectXY=&quot;branding&quot;;
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-(imgwidth+30)+currentX;
y=availableY-(imgheight+20)+currentY;
evalMove();
setTimeout(&quot;checkLocation()&quot;,10);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + horz + &quot;=&quot; + x);
eval(docStyle + objectXY + styleDoc + vert + &quot;=&quot; + y);
}
// End -->
</SCRIPT>

<!-- STEP TWO: Add this onLoad event handler to the BODY tag -->

<BODY onload=&quot;setVariables(); checkLocation();&quot;>

<!-- STEP THREE: Put this code into the BODY of your HTML document -->

<div id=&quot;branding&quot; style=&quot;position:absolute; visibility:show; left:235px; top:-50px; z-index:2&quot;>
<table width=10 bgcolor=#ffffff><td>
<a href=&quot; onmouseover=&quot;window.status='Thanks for visiting!';return true&quot; onmouseout=&quot;window.status='';return true&quot;><center><img src=&quot;your-logo.gif&quot; width=&quot;235&quot; height=&quot;19&quot; border=&quot;0&quot;></center></a></font></td>
</table>
</div>

<p><center>
<font face=&quot;arial, helvetica&quot; size=&quot;-2&quot;>Free JavaScripts provided<br>
by <a href=&quot; JavaScript Source</a></font>
</center><p>
 
Perfect! awesome. thanks!
just what i needed and meant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top