doing some exercises to learn more about DHTML and javascript- while not important, i am just trying to get a foundation. MY question is why does the “slideBar” left and top styles remain the same for each mouse over…i am expecting it to move to where i am mousing over.
[code=php]
var subject;
var slideBar;
//happens onload
function makemenu()
{
var tags=document.getElementsByTagName(“a”);
for(g=0;g<tags.length;g++)
{
var tg=tags[g];
if(tg.addEventListener){
tg.addEventListener(“mouseover”,expand,false);
}else{
tg.setAttribute(“onmouseover”,expand);
}
}
slideBar=document.createElement(‘div’);
slideBar.id=”slideBar”;
slideBar.className=”whiteBar hide”;
document.getElementById(“menu1″).appendChild(slideBar);
}
function expand(e)
{
subject=this;
//define the event
var event=(ie)? window.event : e;
var hereX=this.style.left;
var hereY=this.style.top;
slideBar.className=”whiteBar”
slideBar.style.left=hereX
slideBar.style.top=hereY
if(this.addEventListener){
this.addEventListener(“mouseout”,collapseBar,false);
}else{
this.setAttribute(“onmouseout”,collapseBar);
}
}