Skip to content

Instantly share code, notes, and snippets.

@AntonTrollback
Created September 7, 2015 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntonTrollback/134d8ba149f7bad10906 to your computer and use it in GitHub Desktop.
Save AntonTrollback/134d8ba149f7bad10906 to your computer and use it in GitHub Desktop.
Fix Safari issue where svg <use> might not display in unless forced to rerender at page load
var els = document.getElementsByTagName('use');
Array.prototype.forEach.call(els, function(el) {
el.setAttribute('xlink:href', el.getAttribute('xlink:href'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment