addClass function on a SVG circle doesnt work
Hi,
i have the following test code in my html page
- <div id="drawingArea">
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="700" height="400">
- <circle id="example" cx="335.4999" cy="234.38927" r="8" style="cursor: move;" fill-opacity="0.1"></circle>
- </svg>
- </div>
It draws a simple circle.
So, after document is loaded, i will give the circle a click event and it should add a css class.
- <script language="javascript" type="text/javascript">
-
- $(document).ready(function()
- {
- $('#example').click(function()
- {
- $('#example').addClass ( 'test_adsdsasadsasadsadsdsa' );
- alert ( 'fooo' );
- });
- });
- </script>
The alert with foo is OK, but no attributes of the css definition are working.
The css class is
- .test_adsdsasadsasadsadsdsa
- {
- fill: #E50B1D; /* Fill color */
- fill-opacity: 1; /* Fill strength */
- stroke-width: 4; /* Border width */
- }
Iam using Raphael and add the same question in their google group too, but they said, its jquery specific. I think, jquery doesnt found my circle. Maybe different id - handling between SVG-specific and plain DOM elements? I have no idea :(
Thanks for help!
greetings