Skip to content

Instantly share code, notes, and snippets.

@Pross
Last active August 29, 2015 13:56
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 Pross/9262487 to your computer and use it in GitHub Desktop.
Save Pross/9262487 to your computer and use it in GitHub Desktop.
$.ResizeCanvasVids = {
init: function(){
$.ResizeCanvasVids.checkLoop()
}
, checkLoop: function(){
$('.bg-video').each( function(){
var video = this
$(video).hide()
var intervalId = setInterval(function() {
if (video.readyState === 4) {
$(window).trigger('resize')
clearInterval(intervalId)
$(video).fadeIn('slow')
return false
} else {
console.log('nope')
}
}, 100);
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment