Reputation: 405
I've just been trying to embed a simple animated SVG image into a HTML web-page with mixed success. After exploring the web a bit, I've found a number of ways to do it and included some in the following example: http://www.theinsanewonderland.com/loli/mekakucityactors/index_test.html
But on my Firefox (v.31, 64bit, Ubuntu) the behavior is quite inconsistent:
<object>
: Behavior as expected, i.e. background image is shown and animation works as expected (+/- 30s for the hands to go once around).<img>
: Background image is not loaded; animation freezes after roughly 20° and then resets a few seconds later (but before the whole 30s of the circumnavigation have passed).<div>
with background
: same as <img>
<iframe>
: same as <object>
Does someone have any experience with this and can explain the differences? And do you observe the same effects with other browsers?
PS: Just tried Chromium, where everything works fine and consistent.
Upvotes: 0
Views: 72
Reputation: 124029
When used as an image i.e. a CSS background or via an <img>
tag an SVG file must be complete in a single file. You need to embed the jpeg background image file as a data uri within the SVG file itself.
The animation problem is an example of bug 1067375 which I fixed a while ago. The fix will appear in Firefox 35 which will be released on 12th of January. You can download an early beta release of that now if you like.
Upvotes: 1