Commit compiled JS
This commit is contained in:
parent
3f144b8fd5
commit
6c1787c9c2
1 changed files with 22 additions and 19 deletions
|
@ -7,26 +7,29 @@
|
|||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
// Find all iframes
|
||||
var $iframes = $( "iframe" );
|
||||
// Find all iframes
|
||||
var $iframes = $( "iframe" );
|
||||
|
||||
// Find and save the aspect ratio for all iframes
|
||||
$iframes.each(function () {
|
||||
// Find and save the aspect ratio for all iframes
|
||||
$iframes.each(function () {
|
||||
$( this ).data( "ratio", this.height / this.width )
|
||||
// Remove the hardcoded width & height attributes
|
||||
.removeAttr( "width" )
|
||||
.removeAttr( "height" );
|
||||
});
|
||||
});
|
||||
|
||||
// Resize the iframes when the window is resized
|
||||
$( window ).resize( function () {
|
||||
// Resize the iframes when the window is resized
|
||||
$( window ).resize( function () {
|
||||
$iframes.each( function() {
|
||||
// Get the parent container's width
|
||||
var width = $( this ).parent().width();
|
||||
$( this ).width( width )
|
||||
.height( width * $( this ).data( "ratio" ) );
|
||||
});
|
||||
// Resize to fix all iframes on page load.
|
||||
}).resize();
|
||||
// Resize to fix all iframes on page load.
|
||||
}).resize();
|
||||
|
||||
})(jQuery);
|
||||
|
||||
// Note that we know we have JQuery because our geofresco/global relies on bulma/global
|
||||
// which pulls in JQuery already.
|
||||
|
|
Loading…
Add table
Reference in a new issue