Xander6669
07-01-2004, 04:01 AM
I found a fade in/fade out script on Google which goes like this:
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.5
else if (which2.filters)
which2.filters.alpha.opacity=50
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
And here is how the img tag must look:
<img src="images/button.gif" border="0" height="31" width="88"
style="filter:alpha(opacity=50);-moz-opacity:0.5" onMouseover="high(this)"
onMouseout="low(this)">
This script makes it so when you have your mouse over the image, there is a graduate fade in. However, when you take your mouse out, it fades out instantly.
Would there be a way to make the fade out graduate?
Thanks a lot.
(I hope I posted this in the good section)
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.5
else if (which2.filters)
which2.filters.alpha.opacity=50
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
And here is how the img tag must look:
<img src="images/button.gif" border="0" height="31" width="88"
style="filter:alpha(opacity=50);-moz-opacity:0.5" onMouseover="high(this)"
onMouseout="low(this)">
This script makes it so when you have your mouse over the image, there is a graduate fade in. However, when you take your mouse out, it fades out instantly.
Would there be a way to make the fade out graduate?
Thanks a lot.
(I hope I posted this in the good section)