OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Two SVG docs and one javascript funciton
This page's ID:
10874
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
So you wanted to do this? (please wait until it loads completely as I didn't add download detection and such): [url=http://www.wapod.com/~ini/SVGevents/TestingSVG.html]http://www.wapod.com/~ini/SVGevents/TestingSVG.html[/url] Simple, my friend... An svg document has NO WAY, at least from what my short experience showed me, to access another SVG document directly. However, an embedded SVG document, in a web page, can call javascript from the web page. And that js can then refer to elements in another [svg] document embedded in the same page. It's what they done at Adobe. See, your <EMBED> tag must have a name="stuff" attribute. we will refer to it as svg_name. And your svg elements, inside the svg documents, should have id="stuff" attributes. Then, the magic code line has to be of the form: document.embeds['svg_name'].getSVGDocument().getElementById('element_name').setAttributeNS(null, "fill", "purple"); But that js should be contained in the html document, in the "container" document. Hope it helps. [This message has been edited by InI (edited 12-11-2002).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »