![]() |
#2
xiaoyuechuan2010-04-23 03:47
|

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
var conut=0;
var w;
var h;
function hehe(){
if(conut==0){
h=parseInt(document.images[0].height);
w=parseInt(document.images[0].width);
for(var i=0;i<200;i++){
document.images[0].height=h+i;
document.images[0].width=w+i;
}
conut=1;
}
else{
document.images[0].height=150;
document.images[0].width=100;
conut=0;
}
}
setInterval("hehe()",1000);
</script>
<img src="../实例及代码/images/2.jpg" height="150" width="100">
</body>
</html>
我想让图像从指定的大小逐渐变成最后规定的大小,可是我写了这个都只是从最开始的大小直接变成最后规定的大小了,请指点下,谢谢了 <title>无标题文档</title>
</head>
<body>
<script language="javascript">
var conut=0;
var w;
var h;
function hehe(){
if(conut==0){
h=parseInt(document.images[0].height);
w=parseInt(document.images[0].width);
for(var i=0;i<200;i++){
document.images[0].height=h+i;
document.images[0].width=w+i;
}
conut=1;
}
else{
document.images[0].height=150;
document.images[0].width=100;
conut=0;
}
}
setInterval("hehe()",1000);
</script>
<img src="../实例及代码/images/2.jpg" height="150" width="100">
</body>
</html>