<div onMouseOver="ShowImage()" onMouseOut="ShowImage()">
<img src="images/index_r3_c9.jpg" width="115" height="115" border="0" >
</div>
JS文件:
function show(){var imgid=document.getElementById("imgid")
if(imgid.style.visibility == "visible")
imgid.style.visibility = "hidden"
else
imgid.style.visibility = "visible"
setTimeout('show()',300)
}
HTML:
<img id="imgid" style="visibility:visible" src="1.jpg" />
<button onclick="show()">按下图片会闪动</button>
不知道你是不是这个意思 发现有点没读懂你想要的东西
已修改,复制粘贴即可<html>
<head>
<meta charset="utf-8" />
<title>cainiao</title>
<script type="text/javascript">
var speed = 0
var timer = null
var oImg = null
var oPa = 0.5
window.onload = function ()
{
oImg = document.getElementById ("img7")
oImg.onmouseover = function ()
{
toMove (1)
}
oImg.onmouseout = function ()
{
toMove (0.5)
}
}
function toMove (i)
{
if (!!timer)
{
clearInterval (timer)
timer = null
}
timer = setInterval (function ()
{
if (i > oPa)
{
speed = 0.1
}
else if (i < oPa)
{
speed = -0.1
}
if (oPa == i)
{
clearInterval (timer)
timer = null
}
else
{
oPa = oPa + speed
}
if (!window.ActiveXObject)
{
oImg.style.opacity = oPa
}
else
{
oImg.style.filter = 'alpha(opacity=' + parseFloat (oPa) * 100 + ')'
}
}, 60)
}
</script>
</head>
<body>
<img id="img7" src="images/scifier.jpg" width="180px"
style="filter:alpha(opacity=50)opacity: 0.5" />
</body>
</html>