Last active
August 29, 2015 14:00
-
-
Save thetoine/dedfcaca441c79e67f59 to your computer and use it in GitHub Desktop.
sketchfab fallback for non supported browsers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-embeded-3d-object='<iframe width="100%" height="480" frameborder="0" allowFullScreen webkitallowfullscreen mozallowfullscreen src="//sketchfab.com/models/cc615fcd8fd04354b370e2107a3ee7bf/embed"></iframe>'> | |
<img src="fallback.jpg"> | |
</div> | |
<script> | |
// insert 3d object for supported browser only | |
if (Modernizr.webgl) { | |
$("[data-embeded-3d-object]").each(function() { | |
var html = $(this).data("embeded-3d-object"); | |
$(this).html(html) | |
}); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment