mirror of
https://github.com/ViViDboarder/Vivid-Casper.git
synced 2024-12-22 19:47:38 +00:00
Merge pull request #81 from halfdan/update-fitvids
Update jquery.fitvids.js to 1.1
This commit is contained in:
commit
1655d519f6
23
assets/js/jquery.fitvids.js
Executable file → Normal file
23
assets/js/jquery.fitvids.js
Executable file → Normal file
@ -1,13 +1,12 @@
|
||||
/*global jQuery */
|
||||
/*jshint multistr:true browser:true */
|
||||
/*jshint browser:true */
|
||||
/*!
|
||||
* FitVids 1.0.3
|
||||
* FitVids 1.1
|
||||
*
|
||||
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
||||
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
||||
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
||||
*
|
||||
* Date: Thu Sept 01 18:00:00 2011 -0500
|
||||
*/
|
||||
|
||||
(function( $ ){
|
||||
@ -20,18 +19,12 @@
|
||||
};
|
||||
|
||||
if(!document.getElementById('fit-vids-style')) {
|
||||
|
||||
var div = document.createElement('div'),
|
||||
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
|
||||
cssStyles = '­<style>.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>';
|
||||
|
||||
div.className = 'fit-vids-style';
|
||||
div.id = 'fit-vids-style';
|
||||
div.style.display = 'none';
|
||||
div.innerHTML = cssStyles;
|
||||
|
||||
ref.parentNode.insertBefore(div,ref);
|
||||
|
||||
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
|
||||
var head = document.head || document.getElementsByTagName('head')[0];
|
||||
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
|
||||
head.appendChild(div.childNodes[1]);
|
||||
}
|
||||
|
||||
if ( options ) {
|
||||
|
Loading…
Reference in New Issue
Block a user