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
saved as normal svg == deleted mouse events?
Re: saved as normal svg == deleted mouse events?
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
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
Re: saved as normal svg == deleted mouse events?
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.