I have created a Div that displays help text when a user clicks on a textbox, checkbox, radio button etc. The Div then scrolls down the left side of the page, keeping it at the top.
It works fine in IE 6 and 7, but I cannot get it to work in Firefox. It just sits there.
I have posted the JS code below that I am using.
Any help would be much appreciated.
David
It works fine in IE 6 and 7, but I cannot get it to work in Firefox. It just sits there.
I have posted the JS code below that I am using.
Code:
//This to enable the floating to work in all browsers, especially IE which has its own syntax eg: scrollTop
//Checks to see if the document is standards compliant
function ieTrueBody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function setVariables()
{
if (navigator.appName == "Netscape")
{
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else
{
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
}
}
function checkLocation()
{
objectXY="divHelp";
var availableX=eval(3);
// var availableY=eval(96);
var availableY=eval(0);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
if (currentY > 96)
{ currentY -= 96;
}
else
{ if (currentY = 0)//if (currentY != 0)
{ availableY=eval(96 - currentY);
}
}
x=availableX+currentX;
// y=availableY+currentY;
y=currentY;
evalMove();
setTimeout("checkLocation()",10);
}
function evalMove()
{
eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}
setVariables();
checkLocation();
Any help would be much appreciated.
David