<html>
<head>
<script language="javascript">
var count = 10;
function Picture()
{
count = Counting(count);
Resize(count);
return false;
}
function Counting(count)
{
if (event.wheelDelta >= 120)
count++;
else if (event.wheelDelta <= -120)
count--;
return count;
}
function Resize(count)
{
abc.style.zoom = count + '0%';
}
</script>
</head>
<body>
<img src="xxx.jpg" id="abc" onmousewheel="Picture()" >
</body>
</html>
我找到一段书上的代码可以实现你要的功能。
<head>
<script language="javascript">
var count = 10;
function Picture()
{
count = Counting(count);
Resize(count);
return false;
}
function Counting(count)
{
if (event.wheelDelta >= 120)
count++;
else if (event.wheelDelta <= -120)
count--;
return count;
}
function Resize(count)
{
abc.style.zoom = count + '0%';
}
</script>
</head>
<body>
<img src="xxx.jpg" id="abc" onmousewheel="Picture()" >
</body>
</html>
我找到一段书上的代码可以实现你要的功能。
在载入的时候我设置为200*200
如果将mouse移上去,怎么才能将图片的大小变为250*250
mouse移走后又成为200*200
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD><BODY>
<input type="button" value="ttttt" onmouseover="this.style.width=200;this.style.height=200" onmouseout="this.style.width=100;this.style.height=100"
>
</BODY>
</HTML>