Raphaeljs and Internet Explorer, problem when clicking an element

后端 未结 2 667
南方客
南方客 2021-01-15 06:36

I have the following piece of code in javascript that basically hide or show a Raphaeljs set when I click on it. It works perfectly well under Google Chrome, FireFox and Saf

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-15 06:44

    roughly similar to another question and I will post the same answer:

    onmousedown worked for me in IE 7,8, and 9

                st[0].onclick = function () {
                    myFunc(dataObj);
                    st.toFront();
                    R.safari();
                };
                st[0].onmousedown = function () {
                    myFunc(dataObj);
                    st.toFront();
                    R.safari();
                };
    

    I tried some other methods as well, abstracting the function to a variable but it didnt work. In my case I cannot add a rectangle to the display and have people click on this, it was a poor solution for several reasons.

    Hope this helps!

提交回复
热议问题