请问哪位有图片变换特效的源代码?

来源:百度知道 编辑:UC知道 时间:2024/06/16 12:56:59
帮帮忙啊 !
急需!!!

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>鼠标放到图片上慢慢变大,移开后图片又慢慢变小</title>

</head>

<body>
<img id=MainImg onmouseover=max() onmouseout=min() src=http://www.jscode.cn/JsCode/images/flag.gif width="85" height="55">
<script>
var i=0
//变大
function max(){
MImg=MainImg.style.pixelWidth+=i++
MainImg.style.pixelHeight=MImg*aaa
if(i<20)setTimeout('max()',100)
}

//变小
function min(){
MImg=MainImg.style.pixelWidth-=i--
MainImg.style.pixelHeight=MImg*aaa
if(i>0)setTimeout('min()',100)
}

function init(){
aaa=MainImg.height/MainImg.width
MainImg.style.pixelWidth=85
MainImg.style.pixelHeight=55
}