Hi Javascript gurus:
I have tried several things, using several Javascript books, but can't get
this to work in Netscape (latest version) and Firefox (latest v.). It works
in MIE and Opera fine. A box (defined by a css layer) is supposed to pop
out to the right when the corresponding box on the far left is moused over.
The first function defines a layer id to the next function which pops out
the box. After debugging in Venkman, it looks like the first function
cannot define the layer id properly to the second function, which actually
slides the box (layer) to the right.
I thought that the getElementById function was supposed to work for Firefox,
but I must be using it wrong(???)
To see how it's supposed to work, view the following page in MIE or Opera:
http://www.tfn.net/~chorale/join_us.html
function makeName(layerI D) {
if (document.all)
{ refname = eval("document. all." + layerID + ".style") }
else if (document.layer s)
{ refname = eval("document. layers(layerID) "); }
else
{ refname = document.getEle mentById("layer ID"); }
// { refname = layerID }
// { refname = eval("document. " + layerID) }
// { refname = eval("document. " + layerID) }
// { refname = layerID; }
return refname;
}
function slide () {
if ((parseInt(laye rname.left) < xgoal) ||
(parseInt(layer name.top) < ygoal))
{ layername.left = parseInt(layern ame.left) + xhop;
layername.top = parseInt(layern ame.top) + yhop;
// window.setTimeo ut("slide()", delay)
}
else if ((parseInt(laye rname.left) == xgoal) ||
(parseInt(layer name.top) == ygoal))
{ layername.left = parseInt(layern ame.left) - xhop;
layername.top = parseInt(layern ame.top) - yhop;
// window.setTimeo ut("slide()", delay)
}
}
This is a portion of the HTML code that calls the box (in this case, the
"sponsors" css class), and assigns it a layer name, which is then passed to
the slide function, which moves the box to the right based on the x & y
coordinates. The box is defined by a css <div class=> statement as
'sponsors'.:
layername=makeN ame('sponsors') ; yhop=0; ygoal=150; xhop=165; xgoal=165;
slide()";
Thanks for any help you can give.
--
Rebecca Levings
Lively Health Products
850-443-4641
rl**********@co mcast.net
http://www.lively.myarbonne.com
https://www.juiceplus.com/athlete/+rl21248