Using Javascript in svg

by tom - uploaded on August 21, 2010, 10:24 pm

Ok, I admit that this isn't really a piece of clipart, however I am proud of it.



This file is an example of using javascript to show/hide svg layers (groups) by id.

Log in to add this clipart to a collection.

Tags
inkscape interactive javascript
Safe for Work?
Yes
Download SVG

Comments

Thanx Tom, I like it!

Tom, I am a novice at Inkscape, but I need to learn how to do this. Where can I find the javascript you used and how can I learn what to do with it in Inkscape?

Thanks for any help you can give me.

Ah, I figured out how you did it by inspecting the object properties of your buttons. Thank you very much for posting this, Tom! I think it has solved my problems!

Glad it helped.

For reference:

In Inkscape:

Select a show/hide button.
Right Click and select "Object Properties".
Then expand the "Interactivity" section. (enter the js into the OnClick box)

There may be better js to do this; but this is simple and it works.

Log in to comment.