Svg Fix for Firefox when base-tag is set
jQuery.svgBaseFix = function() { | |
if ($("base").length) { | |
var Url = window.location.href; | |
// Get rid of existing hashtags | |
var hash = window.location.hash; | |
var CleanUrl = Url.replace(hash, ""); | |
var origin = window.location.origin.length + 1; | |
var trimmedUrl = CleanUrl.substring(CleanUrl.length, origin); | |
$("svg:not(.no-convert) use").each(function(){ | |
var href = $(this).attr("xlink:href"); | |
var str = href.split("?"); | |
str = str[str.length - 1]; | |
$(this).attr("xlink:href", trimmedUrl + str); | |
}); | |
} | |
}; | |
$(document).ready(function(){ | |
$.svgBaseFix(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment