SVG
相关文章:
在Flex中实现自定义的Caret
我对prototype1.4.0的注解
推荐圈子: javascript研究小组
更多相关推荐 function zoomInOut(delta) {
if (delta >= 0)
SvgZoomOut()
else
alert(1)
}
function wheel(event){
var delta = 0;
if (!event) event = window.event;
if (event.wheelDelta) {
delta = event.wheelDelta;
if (window.opera) delta = -delta;
} else if (event.detail) {
delta = -event.detail/3;
}
if (delta)
zoomInOut(delta);
if (event.preventDefault)
event.preventDefault();
event.returnValue = false;
}
function SvgZoomOut()//放大
{ //alert(SVGRoot.currentScale);
SVGRoot.currentScale = SVGRoot.currentScale * vScaleFactor;
}
function Init()//图片加载时事件
{
SVGDocument = evt.target.ownerDocument;
SVGRoot = SVGDocument.documentElement;
newMenuRoot=parseXML(printNode(SVGDocument.getElementById('NewMenu')),contextMenu);
contextMenu.replaceChild(newMenuRoot,contextMenu.firstChild);
orig_x = SVGRoot.currentTranslate.x;
orig_y = SVGRoot.currentTranslate.y;
orig_scale = SVGRoot.currentScale;
IsMove=false;
}
if (window.addEventListener)
window.addEventListener('DOMMouseScroll',wheel,false);
window.onmousewheel = document.onmousewheel = wheel;
不能缩放,能捕捉到滚轮事件!哪位帮忙!