After the page has loaded, I want to use JQuery to grab a data attribute from a div element, which contains a color value. I then want to apply the color value to the SVG images. This works fine in Chrome but not IE/Firefox:
$("div.socialmediaicons svg").load(function(event) {
var socialcoloractive = $(this).closest("div").data("socialcoloractive");
var socialcolorinactive = $(this).closest("div").data("socialcolorinactive");
TweenMax.to(".iconactive svg", 1.5, {
fill: socialcoloractive,
});
TweenMax.to(".iconinactive svg", 1.5, {
fill: socialcolorinactive,
});
});
This closest I've found to a solution is this post: Jquery applying css to load div however I don't know how to modify my code using a callback.
Any help is appreciated, thanks.