SVG

longshine 2008-09-11 04:58:13
相关文章:
在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;


不能缩放,能捕捉到滚轮事件!哪位帮忙!
...全文
104 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
indexbobo 2011-10-28
  • 打赏
  • 举报
回复
直接用多比图形控件多好

87,915

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧