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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating text keep when scrolling.

Status
Not open for further replies.

adamroof

Programmer
Joined
Nov 5, 2003
Messages
1,107
Location
US
Have you seen pages where something along the side scrolls with you when you scroll?

how would i get started on that?

Im looking to add a small "floating" text along a side bar on my page.
Like...

<table>
Questions/Comments?
We'd Love To Hear From You!
suggestionbox@site.com
</table>

not as obtrusive as the tek-tips one on first load either!
(dont get mad tek-tips, love this site)
 
ok, found out by searching these forums...cant remember who, but thanks!

Code:
<html>
<DIV CLASS="jsbrand" ID="jsbrand" STYLE="position:absolute;top:1;visibility:hide;" zIndex="1000" ALIGN="left">
<table border=0 cellpadding=0 cellspacing=0 class=labels width=150 height=50 align=LEFT>
<tr>
    <td>
        Questions/Comments?
    </td>
</tr>
<tr>
    <td>
        We'd Love To Hear From You!
    </td>
</tr>
<tr>
    <td>
        <a href="mailto:suggestions@site.com">suggestions@site.com</a>
    </td>
</tr>
</table>
</DIV> 
<head>

Code:
var image_height = 50;
var up_from_corner = 0;

var JH = 0;JW = 0;JX = 0;JY = 0;
var left = 1;
var up = image_height + up_from_corner + 15;

if (navigator.appVersion.indexOf("MSIE") != -1){
var wm = document.all.jsbrand;
}else if (document.getElementById) {
var wm = document.getElementById("jsbrand");
}else if(navigator.appName == "Netscape"){
var wm = document.jsbrand;
}

function watermark() {

 if (navigator.appVersion.indexOf("MSIE") != -1){
  if (navigator.appVersion.indexOf("Mac") == -1){
   wm.style.display = "none";
   JH = document.body.clientHeight;
   JW = document.body.clientWidth;
   JX = document.body.scrollLeft;
   JY = document.body.scrollTop;
   wm.style.top = (JH+JY-up);
   wm.style.left =(left);
   wm.style.display = "";
  }
 }else if (document.getElementById) {
   JH = window.innerHeight;
   JW = window.innerWidth;
   JX = window.pageXOffset;
   JY = window.pageYOffset;
   wm.style.visibility = "hide";
   wm.style.top = (JH+JY-up);
   wm.style.left = (left);
   wm.style.visibility = "show";
 }else if(navigator.appName == "Netscape") {
   JH = window.innerHeight
   JW = window.innerWidth
   JX = window.pageXOffset
   JY = window.pageYOffset
   wm.visibility = "hide"
   wm.top = (JH+JY-up)
   wm.left = (left)
   wm.visibility= "show"
 }
}

setInterval("watermark()",10);
 
oops...

// you must keep the following lines on when you use this
// original idea from the Geocities Watermark
// © Nicolas -
it was thread216-494445
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top