stephenjbell

SVG external 'use' jQuery polyfill

Aug 21st, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.35 KB | None | 0 0
  1. // http://css-tricks.com/svg-use-external-source/
  2. // Instead of using "SVG for Everybody" to handle IE, maybe we could just load the SVG
  3. // into the page itself?
  4.  
  5.  
  6. $("svg>use").each(function(){
  7.     svgAddress = $(this).attr("xlink:href").replace("#"," #"); // jQuery "load" needs a space between the page and id
  8.     $(this).parent().load(svgAddress);
  9. });
Advertisement
Add Comment
Please, Sign In to add comment