Why isn't this working?
Here is my code with some comments:
<SCRIPT LANGUAGE="JavaScript">
var mkdiv = document.createElement('div'); //create your div
var timer //create timer variable
function showItem(posleft, postop, w, h, linkdetail, n)
//posleft = position from the left
//postop = position from the top
//w = pixelwidth
//h = pixelheight
//linkdetail = URL to be shown in the revealed div
//n = text for URL to be shown in the revealed div
//linkno = string built from linkdetail + n to give innerHTML string for divs innerHTML property.
{
linkno ="<a href = " + "\"" + linkdetail + "\"" + ">" + n + "</a>"
window.clearTimeout(timer)
mkdiv.style.backgroundColor = "lightblue";
mkdiv.style.border = "1px solid black";
mkdiv.style.visibility = "visible"
mkdiv.style.pixelLeft = posleft
mkdiv.style.pixelTop = postop
mkdiv.style.pixelWidth = w
mkdiv.style.pixelHeight = h
mkdiv.style.zIndex = 1
mkdiv.innerHTML = linkno
//all of this syntax looks fine to me, Im just setting variables using arguments!
timer = window.setTimeout("hidewin()", 5000)
}
function hidewin(){
mkdiv.style.visibility = "hidden"
}
</SCRIPT>
<a href = "#" onmouseover="showItem(100, 20, 100, 20, this.linkdetail, this.linktext)" linkdetail = "www.google.com" linktext = "Google">Show Link 1</a><br>
<a href = "#" onmouseover="showItem(100, 40, 100, 20, this.linkdetail, this.linktext)" linkdetail = "www.yahoo.com" linktext = "Yahoo">Show Link 2</a>
The script is running without any complaints, but I can't see the div at all! Any ideas? All arguments are passed in on the onmouseover event, such as width and height, position, stuff like that, but I just cannot see the divs as they are 'supposed' to appear.
Help much appreciated.
Joe
__________________
\'sync\' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
|