BG
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.
- Tags
- inkscape interactive javascript
- Safe for Work?
- Yes
Remixes
No remixes yet — be the first.
Want to remix this clipart?
- Download the SVG
- Edit it in your favourite SVG editor
- Upload with Upload Remix (links automatically)
Sources
No catalog sources linked yet.
I found this clipart!
Related Finds — Openclipart spotted in the wild. Browse all · Atom
No Finds yet.
Log in to post a Found.
Comments
@filtre
2010-08-22 08:56:11+00Thanx Tom, I like it!
@mtompa
2016-12-16 16:44:27+00Tom, 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.
@mtompa
2016-12-16 19:05:46+00Ah, 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!
@tom
2016-12-21 12:08:53+00Glad 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.