当我将光标放在它上面时,我想让我的图像按钮消失。我正在使用我在网上找到的脚本,但它似乎不起作用。
<html>
<head>
<script type="text/javascript">
function FadeOpacity(elemId, fromOpacity, toOpacity, time, fps)
{
var steps = Math.ceil(fps * (time / 1000));
var delta = (toOpacity - fromOpacity) / steps;
FadeOpacityStep(elemId, 0, steps, fromOpacity, delta, (time / steps));
}
function FadeOpacityStep(elemId, stepNum, steps, fromOpacity, delta, timePerStep)
{
SetOpacity(document.getElementById(elemId), Math.round(parseInt(fromOpacity) + (delta * stepNum)));
if (stepNum < steps)
setTimeout("FadeOpacityStep('" + elemId + "', " + (stepNum+1) + ", " + steps + ", " + fromOpacity + ", " + delta + ", " + timePerStep + ");", timePerStep);
}
</script>
</head>
<body>
<form action="opacity.php" method="post">
<input type="image" name="blue" id="ImgAkxl2" value="blue" src="streetfighter.jpg"
onmouseover="UpdateOpacity2()"
/>
</form>
<script language="JavaScript" type="text/javascript">
function UpdateOpacity2()
{
FadeOpacity("ImgAkxl2", 100, 50, 2000, 10);
}
</script>
</body>
</html>