简体   繁体   English

点击进入html5 svg应用程序中的rect

[英]click into a rect within html5 svg application

i have a web application in which i'm using svg and Raphael library: 我有一个使用svgRaphael库的Web应用程序:

 workflowEditor.show();
     var myList = document.getElementsByTagName("rect");
     for (var a = 0; a < myList.length; a++) {
         myList[a].addEventListener("OnClick", function () {
            var index = workflowEditor.getElementIndex(myList[a]);
            alert(index);

         }, true);
     }

i tried to handle the event click into a rectangle but it failed. 我试图处理将事件单击为矩形的操作,但失败了。

What is the problem?How can i fix it? 有什么问题我该如何解决?

Change: 更改:

myList[a].addEventListener("OnClick", function () {

to

myList[a].addEventListener("click", function () {

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM