利用JS动态改变图片大小
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000" onLoad="fade()">
<img src="http://portal.eastchina.com/zergman/img/1.jpg" name="u" border="0" alt="不好玩">
<script language="JavaScript">
var b = 1;
var c = true;
function fade(){
if(document.all);
if(c == true) {
b++;
}
if(b==100) {
b--;
c = false
}
if(b==10) {
b++;
c = true;
}
if(c == false) {
b--;
}
u.width=150 + b;
u.height=125 - b;
setTimeout("fade()",50);
}
</script>
</body>
</html>
51js.com
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000" onLoad="fade()">
<img src="http://portal.eastchina.com/zergman/img/1.jpg" name="u" border="0" alt="不好玩">
<script language="JavaScript">
var b = 1;
var c = true;
function fade(){
if(document.all);
if(c == true) {
b++;
}
if(b==100) {
b--;
c = false
}
if(b==10) {
b++;
c = true;
}
if(c == false) {
b--;
}
u.width=150 + b;
u.height=125 - b;
setTimeout("fade()",50);
}
</script>
</body>
</html>
51js.com
- 没有相关文章
- 没有评论