$(function () { function resizeARKeepTrunc(){ var $element = $('.aspect-ratio'); $('.aspect-ratio').each(function(index ) { var wcalc = $(this).attr('data-width'); var width = $(this).width(); var hcalc = $(this).attr('data-height'); var ar= hcalc / wcalc; var height = width*ar; $(this).animate({ height: height }, 500 ); }); }; $.fn.resized = function (callback, timeout) { $(this).resize(function () { var $this = $(this); if ($this.data('resizeTimeout')) { clearTimeout($this.data('resizeTimeout')); } $this.data('resizeTimeout', setTimeout(callback, timeout)); }); }; resizeARKeepTrunc(); $(window).resized(resizeARKeepTrunc, 300); }); /*******************************************************************/ /* ftrtch dino */ /* [type: JS] [file:aspect-ratio] [40.3837] DESIGN*/ /*******************************************************************/ /* 0.1 P>P */ /* db 131 */