re: handling svg events in parent html document


>In a message 'Accessing the SVG DOM from HTML' a description is given on
how to access SVG from
>HTML, where the SVG is in an embedded object. In my application I want to
do the opposite: handle an SVG
>event in the parent HTML code, or call a parent HTML/Javascript method in
an SVG event handler. 

You can use eventhandlers in SVG just the way You use them in HTML:

For example
<g id='b1' class='bund' onmouseover="return MyFunction('MyParameter');">

would call a Javascript function MyFunction with the parameter MyParameter.
This function may be implemented in the Javascript code of Your surrounding
Concerning the SVG-DOM, you are able to read and manipulate the style,
location and some other information, related to the object type. You have a
variety of eventhandlers, that you might use to access the Javascript

There also exists a very good tutorial on the Adobe Website. You will find
Javascript code that may give you some ideas.

Regards, Bernd.

Received on Friday, 26 May 2000 03:01:44 UTC