<script type="text/javascript">
var h=img1.height;
var w=img1.width;
function blowup()
{
if(img1.height>=h)
{
img1.height=h-100;
img1.width=w-100;
}
}
function reduce()
{
if(img1.height<h)
{
img1.height=h;
img1.width=w;
}
}
function pclose()
{
alert("welcome to myprogram");
}
</script>
</head>
<body onunload="pclose()">
<img src="1.jpg" name="img1" onload="blowup()" onmouseout="blowup()" onmouseover="reduce()" >
</body>基本语法
执行顺序:javascript程序按照在html文件中出现的顺序逐行执行,如果需要在整个html文件中执行,最好将其放在<head>…</head>。
一般不是放head里吗?
o_n
慕妹5461943
JAsx