Your IP : 216.73.216.11


Current Path : /home/digilove/public_html/plugins/system/bdthemes_shortcodes/js/
Upload File :
Current File : /home/digilove/public_html/plugins/system/bdthemes_shortcodes/js/fitframe.min.js

/******************************************
 * jQuery FitFrame
 *
 * A lightweight, easy-to-use jQuery plugin for responsive iframes.
 *
 * Author          @benfosterdev (http://ben.onfabrik.com)
 * Copyright       Copyright (c) 2013 Ben Foster.
 * License         MIT
 * Github          https://github.com/benfoster/FitFrame.js
 * Version         0.1.1
 *
 ******************************************/
!function(t,i,e,s){function n(i,e,s){this.element=t(i),this.options=t.extend({},s,e),this._defaults=s,this._init()}var a="fitFrame",o="plugin_"+a,r="resize",h="wrap";n.prototype={update:function(){this.options.mode===r?this._resizeNew():this._wrapNew()},wrap:function(i){var e=100*this._calculateRatio(i)+"%",s=t("<div/>").addClass(this.options.wrapperCssClass).css("padding-bottom",e);return i.wrap(s).parent()},resize:function(t){return this._setupIframe(t),this._resizeIframe(t,this.element.width(),this.element.height(),this.options.fitHeight),t},destroy:function(){var i=this;i.options.mode===r?(this.element.find("iframe."+this.options.iframeCssClass).each(function(){var e=t(this).data(a);t(this).removeClass(i.options.iframeCssClass).width(e.width).height(e.height).data(a,null)}),this._unbind()):this.element.find("."+this.options.wrapperCssClass).children().unwrap(),this.element.data(o,null)},_init:function(){this.options.fitHeight&&(this.options.mode=r),this.options.mode===r&&this._bind(),this.update()},_wrapNew:function(){var i=this,e=this.element.find("iframe").filter(function(){return!t(this).closest("."+i.options.wrapperCssClass).length});e.each(function(){i.wrap(t(this))})},_resizeNew:function(){var i=this;t("iframe").not(this.options.iframeCssClass).each(function(){i._setupIframe(t(this))}),this._resizeAll()},_setupIframe:function(t){t.data(a,{ratio:this._calculateRatio(t),width:t.width(),height:t.height()}).addClass(this.options.iframeCssClass)},_resizeAll:function(){var i=this,e=this.options.containerWidth.call(this),s=this.options.containerHeight.call(this),n=this.options.fitHeight;this.element.find("iframe."+this.options.iframeCssClass).each(function(){i._resizeIframe(t(this),e,s,n)})},_resizeIframe:function(t,i,e,s){var n=t.data(a).ratio,o=i*n;s&&o>e?t.height(e).width(e/n):t.height(i*n).width("100%")},_calculateRatio:function(t){var i=t.attr("width"),e=t.attr("height");return(e/i).toPrecision(4)},_bind:function(){var e,s=this;t(i).on("resize."+a,function(){clearTimeout(e),e=setTimeout(function(){s._resizeAll()},100)})},_unbind:function(){t(i).off("."+a)}},t.fn[a]=function(i){var e,r=arguments;return this.each(function(){var s=t.data(this,o);if(s){if("string"==typeof i&&"_"!==i[0]){var h=s[i];"function"==typeof h?e=h.apply(s,Array.prototype.slice.call(r,1)):t.error("Public method '"+i+"' does not exist on jQuery."+a)}}else t.data(this,o,new n(this,i,t.fn[a].defaults))}),e!==s?e:this},t.fn[a].defaults={wrapperCssClass:"fitframe-wrap",iframeCssClass:"fitframe",mode:h,fitHeight:!1,containerHeight:function(){return this.element.height()},containerWidth:function(){return this.element.width()}}}(jQuery,window,document);

jQuery(document).ready(function($) {

  $('.su-responsive-frame').fitFrame('update');

});