saved as normal svg == deleted mouse events?

Post questions on how to use or achieve an effect in Inkscape.
cmax
Posts: 4
Joined: Tue Dec 18, 2012 4:06 am

saved as normal svg == deleted mouse events?

Postby cmax » Tue Dec 18, 2012 5:25 am

Hi there,

I've used Inkscape (0.48.2, Win7) to create some link buttons with onmouseover events. If I save the file as inkscape svg everything works fine.

But saved as normal svg (to keep the finally published svg small and readable) the onmouseover/-out attributes in the link or group elements (<a>/<g>) are deleted.

Why? I thought these mouse attributes are part of the normal SVG specification, aren't they?

Regards

max

Jelle
Posts: 78
Joined: Sat Nov 06, 2010 11:25 am

Re: saved as normal svg == deleted mouse events?

Postby Jelle » Fri Dec 21, 2012 3:41 pm

Hi Max,

Unfortunately saving to plain SVG strips out everything not purely SVG. onmouseout/over are not pure SVG and certainly not in the specs as far as I know it, but script related. It would strip out SMIl script too for that matter. It's one of the reasons why I would suggest you to separate logic and graphics. You can easily create a logic file with the <use xlink:href="filename#object"> syntax to load all the graphics objects by ID and manipulate them. Added benefit is that you will create two easily reusable SVG files. So you can easily change the graphics to a SVG website, or change the logic you use on graphics ;-)

Jelle
Posts: 78
Joined: Sat Nov 06, 2010 11:25 am

Re: saved as normal svg == deleted mouse events?

Postby Jelle » Fri Dec 21, 2012 3:42 pm

Oh,.. btw,.. there is also Optimised SVG a bit down the list that will do basically the same as plain SVG, but will not touch the script elemants. It is a later export filter than plain.


Return to “Help with using Inkscape”