SVG Stacking
===============
Full tutorial: http://hofmannsven.com/2013/laboratory/svg-stacking/
Demo (with a div): http://hofmannsven.com/demo/svg-stacking/
Demo (with a background image): http://hofmannsven.com/demo/svg-stacks/background/
(function($) {
$(document).ready(function() {
// Fixing the WebKit Issues
$('div a').fixSVGStackBackground();
$('img').fixSVGStack();
});
if (Modernizr.svg) {
// Finally we are using the SVG Image via the hash
// but only if the browser can handle it...
$('#svg a').html('<img src="img/stacked-demo-stack.svg#layer" width="60" height="60" alt="SVG Stacked Image" />');
} else {
// ...and proving a PNG Image for older browsers!
$('#svg a').html('<img src="img/fallback-demo-stack.png" width="60" height="60" alt="Fallback for the SVG Stacked Image" />');
}
})(jQuery);
<div id="svg">
<a href="http://hofmannsven.com">
<!-- Fallback if JavaScript is disabled -->
<img
src="img/fallback-demo-stack.png"
width="60"
height="60"
alt="Fallback for the SVG Stacked Image"
/>
</a>
</div>