你所在的位置:搜豹网络学堂 | 网页制作 | JavaScript
鼠标感应自动放大缩小的图片链接

 

第一步,将下面的代码加入<head></head>之间

<script language="JavaScript">

function expand() {
if (smallslot.width<=80) {
x=window.setTimeout('expand()', 10)
smallslot.width=smallslot.width + 5
smallslot.height=smallslot.height + 5
}
else {
setTimeout('reduce()', 0)
}
}

function reduce() {
if (smallslot.width>50) {
x=window.setTimeout('reduce()', 10)
smallslot.width=smallslot.width - 5
smallslot.height=smallslot.height - 5
}
}
</script>

第二步:将下面的源代码加入<body></body>之间

<div id="slot1" onmouseover="expand()" style="HEIGHT: 80px; WIDTH: 80px"><a href="http://www.sobao.com/" >
<dd><img border="0" hspace="0" id="smallslot" src="Cool.gif" style="LEFT: 150px; POSITION: absolute; TOP: 200px; VISIBILITY: visible; z: 2" WIDTH="80" HEIGHT="80"></a> </dd>
</div>


网站简介
| 网站导航 | 帮助信息 | 联系我们 | 我们的服务
建议用800*600分辨率,IE4.0以上版本浏览
Copyright © 1999-2001 SOBAO.com
版权所有 搜豹公司