以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  [转帖]Disable the Context Sensitive Menu  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=14842)


--  作者:SCYANGYU
--  发布时间:2/27/2005 12:25:00 PM

--  [转帖]Disable the Context Sensitive Menu
Disable the Context Sensitive Menu

How To: Disable the Context Sensitive Menu

You can disable the SVG Viewer Context Sensitive menu by trapping events in an element.
Example:
Make a 0% opacity rect the size of the SVG that would receive and preventDefault() all appropriate events.

Note that our popup menu honors platform UI, so there are some differences between Mac and Win in terms of which events to trap for.

<svg>
<script language="Javascript">

function handleIt(evt)
{
evt.preventDefault();
}
</script>

<g id="square"   onmouseup="handleIt(evt)"  transform="translate(50 50)">
<rect x="0" y="0" width="100" height="100" style="stroke-width:2;fill:yellow; stroke:blue"/>
</g>
</svg>

http://support.adobe.com/devsup/devsup.nsf/docs/50526.htm


--  作者:henrybenben
--  发布时间:4/13/2005 11:25:00 PM

--  
thanks  a lot!
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
30.762ms