The assignment was to create an animated menu for a fictional search engine. I eventually got one to work and here it is:
http://www.digitalmatt.net/DHTML/midterm/index2.html
Here’s the code:
var position
var intHide
function show()
{
position = document.getElementById("shopmenu").style
if (parseInt(position.top) != 30)
{
position = document.getElementById("shopmenu").style
position.top = parseInt(position.top) - 10 + "px"
}
}
function showmenu()
{
clearInterval(intHide)
intShow = setInterval("show()",10)
}
function hide()
{
position = document.getElementById("shopmenu").style
if (parseInt(position.top) < 200)
{
position = document.getElementById("shopmenu").style
position.top = parseInt(position.top) + 10 + "px"
}
}
function hidemenu()
{
clearInterval(intShow)
intHide = setInterval("hide()",10)
}
“Shop” is the only link with an event.
Now to get the rest of the links to use the same functions. I just simply wanted to pass the value (in this case, which DIV to slide up or down) inside the mouse events “showmenu()” and “hidemenu()” I tried it and am getting a “has no properties” error. Here it is:
http://www.digitalmatt.net/DHTML/midterm/index3.html
Any ideas?