<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
>
<
HTML
>
<
HEAD
>
<
TITLE
>
New Document
</
TITLE
>
<
META
NAME
="Generator"
CONTENT
="EditPlus"
>
<
META
NAME
="Author"
CONTENT
=""
>
<
META
NAME
="Keywords"
CONTENT
=""
>
<
META
NAME
="Description"
CONTENT
=""
>
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
<
SCRIPT
LANGUAGE
="JavaScript"
>
<!--
function ZoomImg(o)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom += event.wheelDelta / 12;
if(zoom > 0)
o.style.zoom = zoom + '%';
return false;
}
![](/Images/OutliningIndicators/InBlock.gif)
var oEventUtil = new Object();
oEventUtil.AddEventHandler = function(oTarget,sEventType,fnHandler)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
{
//IE和FF的兼容性处理
//如果是FF
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if(oTarget.addEventListener)
{
oTarget.addEventListener(sEventType,fnHandler,false);
}
//如果是IE
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
else if(oTarget.attachEvent)
{
oTarget.attachEvent('on'+sEventType,fnHandler);
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
oTarget['on'+sEventType] = fnHandler;
}
};
//定义oT事件函数
var oT = function()
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
{
var oEvent = arguments[0];
var oTarget = oEvent.target || oEvent.srcElement;
ZoomImg(oTarget);
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
//-->
</
SCRIPT
>
</
HEAD
>
![](/Images/OutliningIndicators/None.gif)
<
BODY
>
<
img
src
="images/1.jpg"
width
="200"
height
="200"
>
<
br
>
<
div
id
="div1"
>
<
img
src
="images/1.jpg"
>
<
img
src
="images/1.jpg"
width
="200"
height
="200"
>
</
div
>
</
BODY
>
</
HTML
>
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
<
SCRIPT
LANGUAGE
="JavaScript"
>
<!--
_div1=document.getElementById("div1");
![](/Images/OutliningIndicators/InBlock.gif)
var oPList = _div1.getElementsByTagName('img');
![](/Images/OutliningIndicators/InBlock.gif)
for(var i = 0;i<oPList.length;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
{
oPList[i].alt='鼠标滚轮放大/缩小图片';
//alert(oPList[i].addAttribute('alt','鼠标滚轮放大'));
//oPlist[i].addAttribute('alt','鼠标滚轮放大/缩小图片');
oEventUtil.AddEventHandler(oPList[i],'mousewheel',oT);
}
//-->
</
SCRIPT
>
转载于:https://www.cnblogs.com/gbsck/archive/2008/03/31/1131495.html