Skip to content

Instantly share code, notes, and snippets.

@thetoine
Last active August 29, 2015 14:00
Show Gist options
  • Save thetoine/dedfcaca441c79e67f59 to your computer and use it in GitHub Desktop.
Save thetoine/dedfcaca441c79e67f59 to your computer and use it in GitHub Desktop.
sketchfab fallback for non supported browsers
<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