Created
April 18, 2016 03:57
-
-
Save webhasan/3494a82cd0d05de1e34c36d16e45c5a6 to your computer and use it in GitHub Desktop.
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
videoResponsive: function() { | |
var vidHeight, | |
vidWidth; | |
function videoRatio() { | |
if(window.innerWidth < 768 ) { | |
vidWidth = window.innerWidth - 30; | |
vidHeight = Math.round(9 / 16 * vidWidth ); | |
}else if(window.innerWidth < 993 ) { | |
vidWidth = 720; | |
vidHeight = 405; | |
}else { | |
vidWidth = 940; | |
vidHeight = 529; | |
} | |
$('.video-popup').each(function(){ | |
var vidLink = $(this).attr('href'); | |
$(this).attr('href',vidLink + '?width='+vidWidth+'&height='+vidHeight+''); | |
}); | |
} | |
videoRatio(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment