Merge pull request #81 from halfdan/update-fitvids
Update jquery.fitvids.js to 1.1
This commit is contained in:
commit
1655d519f6
|
@ -1,13 +1,12 @@
|
||||||
/*global jQuery */
|
/*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
|
* 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/
|
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
||||||
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
||||||
*
|
*
|
||||||
* Date: Thu Sept 01 18:00:00 2011 -0500
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
@ -20,18 +19,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!document.getElementById('fit-vids-style')) {
|
if(!document.getElementById('fit-vids-style')) {
|
||||||
|
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
|
||||||
var div = document.createElement('div'),
|
var head = document.head || document.getElementsByTagName('head')[0];
|
||||||
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[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%;}';
|
||||||
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>';
|
var div = document.createElement('div');
|
||||||
|
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
|
||||||
div.className = 'fit-vids-style';
|
head.appendChild(div.childNodes[1]);
|
||||||
div.id = 'fit-vids-style';
|
|
||||||
div.style.display = 'none';
|
|
||||||
div.innerHTML = cssStyles;
|
|
||||||
|
|
||||||
ref.parentNode.insertBefore(div,ref);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( options ) {
|
if ( options ) {
|
||||||
|
|
Loading…
Reference in New Issue