bvoegele
01-25-2005, 04:28 AM
I've found a script out there to do what I want, which is to position a picture in the upper right corner of the window. The script works well in IE6, but I'm having troubles getting it to work in Netscape. I've followed the variables all the way through in Netscape, and they're correct into the checkLocation function. However, I don't get anything out of the evalMove function. What am I overlooking? All I can guess is that document.dynloadarea.left/top aren't valid (dynloadarea is a DIV id)
I'm new to this, so I'm sure it's something easy, but I don't see it.
Thanks for your help.......Brett
Piece of the code:
function setVariables() {
imgwidth=300; // logo width, in pixels
imgheight=400; // logo height, in pixels
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
}
}
function checkLocation() {
objectXY="dynloadarea";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-(imgwidth+20)+currentX;
y=currentY+10;
evalMove();
setTimeout("checkLocation()",10);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}
I'm new to this, so I'm sure it's something easy, but I don't see it.
Thanks for your help.......Brett
Piece of the code:
function setVariables() {
imgwidth=300; // logo width, in pixels
imgheight=400; // logo height, in pixels
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
}
}
function checkLocation() {
objectXY="dynloadarea";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-(imgwidth+20)+currentX;
y=currentY+10;
evalMove();
setTimeout("checkLocation()",10);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}