jeudi 19 février 2015

onload event for snap svg image not firing in Internet Explorer or Safari

I am trying to dynamically load images in Snap.svg and then once the image has loaded do some processing to it. The load event is firing in Chrome, Firefox and Opera but is does not fire in Internet Explorer or Safari.


I have this setup in Plunker



var s = null;
var g = null;
var image = null;

//$(document).ready(function($) {
$(window).load(function() {
s = Snap("#svgout");
g = s.g();

$("#baseimage").attr("src", "http://ift.tt/19EM7jY");

$("#baseimage").on("load", function() {
console.log("hidden image loaded");
image = g.image($(this).attr("src"), 0,0, 400,400);

image.node.onload = function () {
console.log("svg image loaded 1");
};

$(image.node).on("load", function() {
console.log("svg image loaded 2");
});
});
});


Any ideas how to make the onload event fire on an svg image load in Internet Explorer and Safari?


Aucun commentaire:

Enregistrer un commentaire