Eksternt JS virker ikke
Hej eksperter,Jeg er ikke voldsomt trænet i JS, så fejlen er nok ganske enkel. Anyway, her er min HTML-del (index.html):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>OVRKLL - Maps</title>
<link rel="shortcut icon" href="icon.ico">
<link rel="stylesheet" type="text/css" href="global.css">
<link rel="stylesheet" type="text/css" href="maps.css">
<script type="text/javascript" src="global.js"></script>
</head>
<body>
<div id="contact" onmouseover="Contact_Show()" onmouseout="Contact_Hide()">
<h1>Contact</h1>
<div>
</div>
</div>
</body>
</html>
Og min JS-del (global.js):
// Contact
var Contact_Fade;
function Contact_Show()
{
alert("TEST!");
clearInterval(Contact_Fade);
Contact_Fade = setInterval("Contact_FadeIn()", 20);
}
function Contact_Hide()
{
clearInterval(Contact_Fade);
Contact_Fade = setInterval("Contact_FadeOut()", 20);
}
function Contact_FadeIn()
{
var reference = document.getElementById("contact").style;
if (+reference.opacity < .97)
{
reference.opacity = +reference.opacity + .03;
return;
}
clearInterval(Contact_Fade);
+reference.opacity = 1;
}
function Contact_FadeOut()
{
var reference = document.getElementById("contact").style;
if (+reference.opacity > .26)
{
reference.opacity = +reference.opacity - .01;
return;
}
clearInterval(Contact_Fade);
+reference.opacity = .25;
}
onmouseover virker ikke - hvorfor?
