![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I am a cut-n-paste javascript user and trying to update this script. I have tried adding +"px" to the barW and barH lines. But that didnt get it to work. |
#2
| |||
| |||
|
|
rfr a écrit : I am a cut-n-paste javascript user and trying to update this script. I have tried adding +"px" to the barW and barH lines. But that didnt get it to work. This bellow works for me in Firefox, you can put this script in the head of your page(s) script language="JavaScript1.2" type="text/javascript" // Based on watermark script by Paul Anderson, CNET Builder.com. // All rights reserved. // and then ? // it was no more working ... so ... the rights ... var markW = 90, // pixels wide markH = 40, // pixels high markX = 99, // percent right markY = 99, // percent down markRefresh = 50; // milliseconds var posX, posY, wMark, navDOM, markID; function setVals() { var barW = 0; // scrollbar compensation for PC Nav var barH = 0; if (navDOM) { if (document.height > innerHeight) barW = 20; if (document.width > innerWidth) barH = 20; } else { innerWidth = document.body.clientWidth; innerHeight = document.body.clientHeight; } posX = ((innerWidth - markW)-barW) * (markX/100); posY = ((innerHeight - markH)-barH) * (markY/100); } function wRefresh() { wMark.left = posX + (navDOM?pageXOffset:document.body.scrollLeft) +'px'; wMark.top = posY + (navDOM?pageYOffset:document.body.scrollTop) + 'px'; } function markMe() { // set common object reference wMark = document.all ? document.all['waterMark'].style : document.getElementById? document.getElementById('waterMark').style : document.waterMark; navDOM = window.innerHeight; // Nav DOM flag wMark.width = markW; wMark.height = markH; setVals(); window.onresize=setVals; markID = setInterval ("wRefresh()",markRefresh); } window.onload=markMe; // safety for Mac IE4.5 /script This script works with an associated div somewhere (preferably at end) in the body of the page : div id="waterMark" style="position:absolute" a href="#" onClick="window.scrollTo(0,0)" top /a /div -- sm |
#3
| |||
| |||
|
|
Thank you. That does work in FireFox, Opera and Netscape. But it does not work in MSIE 7.0. I have no idea why it doesnt work in MSIE 7.0 And since MSIE is such a large part of the visitor audience, it has to work there too. "SAM" <stephanemoriaux.NoAdmin (AT) wanadoo (DOT) fr.invalid> wrote in message news:48655f3c$0$923$ba4acef3 (AT) news (DOT) orange.fr... rfr a écrit : I am a cut-n-paste javascript user and trying to update this script. I have tried adding +"px" to the barW and barH lines. But that didnt get it to work. This bellow works for me in Firefox, you can put this script in the head of your page(s) script language="JavaScript1.2" type="text/javascript" // Based on watermark script by Paul Anderson, CNET Builder.com. // All rights reserved. // and then ? // it was no more working ... so ... the rights ... var markW = 90, // pixels wide markH = 40, // pixels high markX = 99, // percent right markY = 99, // percent down markRefresh = 50; // milliseconds var posX, posY, wMark, navDOM, markID; function setVals() { var barW = 0; // scrollbar compensation for PC Nav var barH = 0; if (navDOM) { if (document.height > innerHeight) barW = 20; if (document.width > innerWidth) barH = 20; } else { innerWidth = document.body.clientWidth; innerHeight = document.body.clientHeight; } posX = ((innerWidth - markW)-barW) * (markX/100); posY = ((innerHeight - markH)-barH) * (markY/100); } function wRefresh() { wMark.left = posX + (navDOM?pageXOffset:document.body.scrollLeft) +'px'; wMark.top = posY + (navDOM?pageYOffset:document.body.scrollTop) + 'px'; } function markMe() { // set common object reference wMark = document.all ? document.all['waterMark'].style : document.getElementById? document.getElementById('waterMark').style : document.waterMark; navDOM = window.innerHeight; // Nav DOM flag wMark.width = markW; wMark.height = markH; setVals(); window.onresize=setVals; markID = setInterval ("wRefresh()",markRefresh); } window.onload=markMe; // safety for Mac IE4.5 /script This script works with an associated div somewhere (preferably at end) in the body of the page : div id="waterMark" style="position:absolute" a href="#" onClick="window.scrollTo(0,0)" top /a /div -- sm |
![]() |
| Thread Tools | |
| Display Modes | |
| |