141
Coding / This JavaScript doesn't work on IE
« on: May 24, 2007, 08:57:48 pm »
Title ^
Link:
http://www.zerowebdesign.nl/beta/
JavaScript:
HTML:
I have no clue how to make this possible in Internet Explorer, it's very important that it does for it.
Any idea how to fix this?
Link:
http://www.zerowebdesign.nl/beta/
JavaScript:
Code: [Select]
var defaultopacity = 30;
function slowhigh(which2)
{
imgobj = which2;
browserdetect = which2.filters? "MSIE" : typeof which2.style.MozOpacity == "string" ? "mozilla" : "";
instantset(defaultopacity);
highlighting = setInterval("gradualfade(imgobj)",50);
}
function slowlow(which2)
{
cleartimer();
instantset(defaultopacity);
}
function instantset(degree)
{
if (browserdetect == "mozilla")
{
imgobj.style.MozOpacity = degree/100;
}
else if (browserdetect == "MSIE")
{
imgobj.filters.alpha.opacity = degree;
}
}
function cleartimer()
{
if (window.highlighting)
{
clearInterval(highlighting);
}
}
function gradualfade(cur2)
{
if (browserdetect == "mozilla" && cur2.style.MozOpacity<1)
{
cur2.style.MozOpacity = Math.min(parseFloat(cur2.style.MozOpacity) + 0.1, 0.99);
}
else if (browserdetect == "MSIE" && cur2.filters.alpha.opacity < 100)
{
cur2.filters.alpha.opacity = 30;
}
else if (window.highlighting)
{
clearInterval(highlighting);
}
}
HTML:
Code: [Select]
<a href="#" onMouseover="slowhigh(this)" onMouseout="slowlow(this)" class="nav">Home</a>
I have no clue how to make this possible in Internet Explorer, it's very important that it does for it.
Any idea how to fix this?