rfr a écrit :
This below works for me in Firefox,
you can put this script in the head of your page(s)
This script works with an associated div somewhere (preferably at end)
in the body of the page :
--
sm
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.
I have tried adding +"px" to the barW and barH lines. But that didnt get it
to work.
you can put this script in the head of your page(s)
Code:
<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 :
Code:
<div id="waterMark" style="position:absolute"> <a href="#" onClick="window.scrollTo(0,0)"> top </a> </div>
--
sm
Comment