<html>
<head>
<meta http
equiv="Content
Type" content="text/html; charset=gb
">
<title>網頁特效觀止|www
jscode
cn|
鼠標放到圖片上慢慢變大
移開後圖片又慢慢變小</title>
</head>
<body>
<img id=MainImg onmouseover=max() onmouseout=min() src=http://www
jscode
cn/JsCode/images/flag
gif width="
" height="
">
<script>
var i=
//變大
function max(){
MImg=MainImg
style
pixelWidth+=i++
MainImg
style
pixelHeight=MImg*aaa
if(i<
)setTimeout(
max()
)
}
//變小
function min(){
MImg=MainImg
style
pixelWidth
=i
MainImg
style
pixelHeight=MImg*aaa
if(i>
)setTimeout(
min()
)
}
function init(){
aaa=MainImg
height/MainImg
width
MainImg
style
pixelWidth=
MainImg
style
pixelHeight=
}
onload=init
</script></body>
</html>
提示您可以先修改部分代碼再運行
在IEFF中測試只在IE出現文字溢出現象
說明注釋造成文字溢出是IE的BUG
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20017.html