一种奇妙的放大或缩小图片或文本的网页特效!

你把下面的代码复制过去一试便知。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<p>
<SCRIPT>
function bbimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}
</script>
  <img src="images/ff36.gif" onmousewheel="return bbimg(this)"  width="150" height="127"></p>
<div onmousewheel="return bbimg(this)">
<p>
你只要把鼠标移到想要放大或缩小的图片或文本上,滚动鼠标滚轮,就可随意地放大或缩小图片或方本了。神奇吧,更妙的还在后面呢,令你吃惊的是实现这种效果,只要一句JS代码。</p></div>
</body>
</html>

posted on 2005-06-20 09:26  轻松逍遥子  阅读(585)  评论(0编辑  收藏  举报