以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 SVG/GML/VRML/X3D/XAML 』 (http://bbs.xml.org.cn/list.asp?boardid=21) ---- 有没有朋友搞过SVG的图形移动??? (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=15369) |
-- 作者:moonsky731 -- 发布时间:3/11/2005 10:17:00 AM -- 有没有朋友搞过SVG的图形移动??? 大家都知道,在html的Embed长宽大小是固定的,我用ZoomIn把图像放大后,一般viewer会默认看到的是原图左上角的一部分,这样其他部分就看不到,大家有没有写过类似的JS来控制放大后图形的托拽????就像ACDSee那样,一个图形如果太大,可以通过手型光标托拽?????? |
-- 作者:edison1024 -- 发布时间:3/12/2005 10:49:00 AM -- 用viewbox就可以了。具体自己去查吧。 |
-- 作者:SCYANGYU -- 发布时间:3/14/2005 8:00:00 AM -- 论坛中前面有一个例子,大家可以看看! |
-- 作者:molester -- 发布时间:3/22/2005 11:14:00 AM -- 拖动的话,你去记录屏幕坐标的变化,然后换算成绝对坐标的变化,修改viewbox就可以了 |
-- 作者:mi9 -- 发布时间:3/29/2005 9:47:00 AM --
那具体的转换思路是什么呢?透露一下吧 |
-- 作者:henrybenben -- 发布时间:4/13/2005 10:45:00 PM -- setCurrentRoom(); } // end function Initialize() function setCurrentRoom(){ viewBox = SVGRoot.getAttribute('viewBox'); if (currentPosition % 400 != 0) { } // currentPosition = parseFloat(viewVals[0]); if (goRight == true){ viewVals[0] = currentPosition; setCurrentRoom(); function toExec(){ if (currentRoomId == null) { alert("Ambiguous room position! \n Please align a room "+ } else { SVGDoc.getElementById(currentRoomId+"Rect") innerSVG = SVGDoc.getElementById(currentRoomId); oldChild = SVGDoc.getElementById(currentRoomId+"Label"); oldChild = SVGDoc.getElementById(currentRoomId+"Type"); myData = SVGDoc.createTextNode(currentRoomLabel); } } // end function toExec() |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
53.711ms |