Current File : /home/n742ef5/royalanteam.com/wp-content/plugins/Ultimate_VC_Addons/assets/min-js/fixto.min.js
var fixto=function(s,t,r){var h=(n={getAll:function(t){return r.defaultView.getComputedStyle(t)},get:function(t,i){return this.getAll(t)[i]},toFloat:function(t){return parseFloat(t,10)||0},getFloat:function(t,i){return this.toFloat(this.get(t,i))},_getAllCurrentStyle:function(t){return t.currentStyle}},r.documentElement.currentStyle&&(n.getAll=n._getAllCurrentStyle),n),o=(i.prototype={replace:function(){var t=this.replacer.style,i=h.getAll(this.element);t.width=this._width(),t.height=this._height(),t.marginTop=i.marginTop,t.marginBottom=i.marginBottom,t.marginLeft=i.marginLeft,t.marginRight=i.marginRight,t.cssFloat=i.cssFloat,t.styleFloat=i.styleFloat,t.position=i.position,t.top=i.top,t.right=i.right,t.bottom=i.bottom,t.left=i.left,t.display=i.display},hide:function(){this.replacer.style.display="none"},_width:function(){return this.element.getBoundingClientRect().width+"px"},_widthOffset:function(){return this.element.offsetWidth+"px"},_height:function(){return this.element.getBoundingClientRect().height+"px"},_heightOffset:function(){return this.element.offsetHeight+"px"},destroy:function(){for(var t in s(this.replacer).remove(),this)this.hasOwnProperty(t)&&(this[t]=null)}},r.documentElement.getBoundingClientRect().width||(i.prototype._width=i.prototype._widthOffset,i.prototype._height=i.prototype._heightOffset),{MimicNode:i,computedStyle:h});function i(t){this.element=t,this.replacer=r.createElement("div"),this.replacer.style.visibility="hidden",this.hide(),t.parentNode.insertBefore(this.replacer,t)}function e(){this._vendor=null}e.prototype={_vendors:{webkit:{cssPrefix:"-webkit-",jsPrefix:"Webkit"},moz:{cssPrefix:"-moz-",jsPrefix:"Moz"},ms:{cssPrefix:"-ms-",jsPrefix:"ms"},opera:{cssPrefix:"-o-",jsPrefix:"O"}},_prefixJsProperty:function(t,i){return t.jsPrefix+i[0].toUpperCase()+i.substr(1)},_prefixValue:function(t,i){return t.cssPrefix+i},_valueSupported:function(t,i,e){try{return e.style[t]=i,e.style[t]===i}catch(t){return!1}},propertySupported:function(t){return void 0!==r.documentElement.style[t]},getJsProperty:function(t){if(this.propertySupported(t))return t;if(this._vendor)return this._prefixJsProperty(this._vendor,t);var i,e;for(e in this._vendors)if(i=this._prefixJsProperty(this._vendors[e],t),this.propertySupported(i))return this._vendor=this._vendors[e],i;return null},getCssValue:function(t,i){var e,o,n=r.createElement("div"),s=this.getJsProperty(t);if(this._valueSupported(s,i,n))return i;if(this._vendor&&(e=this._prefixValue(this._vendor,i),this._valueSupported(s,e,n)))return e;for(o in this._vendors)if(e=this._prefixValue(this._vendors[o],i),this._valueSupported(s,e,n))return this._vendor=this._vendors[o],e;return null}};var l,n=new e,p=n.getJsProperty("transform");var d,a=n.getCssValue("position","sticky"),f=n.getCssValue("position","fixed");function c(t,i,e){this.child=t,this._$child=s(t),this.parent=i,this.options={className:"fixto-fixed",top:0,mindViewport:!1},this._setOptions(e)}function u(t,i,e){c.call(this,t,i,e),this._replacer=new o.MimicNode(t),this._ghostNode=this._replacer.replacer,this._saveStyles(),this._saveViewportHeight(),this._proxied_onscroll=this._bind(this._onscroll,this),this._proxied_onresize=this._bind(this._onresize,this),this.start()}function _(t,i,e){c.call(this,t,i,e),this.start()}"Microsoft Internet Explorer"===navigator.appName&&(d=parseFloat(navigator.appVersion.split("MSIE")[1])),c.prototype={_mindtop:function(){var t=0;if(this._$mind)for(var i,e,o=0,n=this._$mind.length;o<n;o++)(e=(i=this._$mind[o]).getBoundingClientRect()).height?t+=e.height:(e=h.getAll(i),t+=i.offsetHeight+h.toFloat(e.marginTop)+h.toFloat(e.marginBottom));return t},stop:function(){this._stop(),this._running=!1},start:function(){this._running||(this._start(),this._running=!0)},destroy:function(){for(var t in this.stop(),this._destroy(),this._$child.removeData("fixto-instance"),this)this.hasOwnProperty(t)&&(this[t]=null)},_setOptions:function(t){s.extend(this.options,t),this.options.mind&&(this._$mind=s(this.options.mind)),this.options.zIndex&&(this.child.style.zIndex=this.options.zIndex)},setOptions:function(t){this._setOptions(t),this.refresh()},_stop:function(){},_start:function(){},_destroy:function(){},refresh:function(){}},u.prototype=new c,s.extend(u.prototype,{_bind:function(t,i){return function(){return t.call(i)}},_toresize:8===d?r.documentElement:t,_onscroll:function(){this._scrollTop=r.documentElement.scrollTop||r.body.scrollTop,this._parentBottom=this.parent.offsetHeight+this._fullOffset("offsetTop",this.parent),!1!==this.options.mindBottomPadding&&(this._parentBottom-=h.getFloat(this.parent,"paddingBottom")),!this.fixed&&this._shouldFix()?(this._fix(),this._adjust()):this._scrollTop>this._parentBottom||this._scrollTop<this._fullOffset("offsetTop",this._ghostNode)-this.options.top-this._mindtop()?this._unfix():this._adjust()},_shouldFix:function(){if(this._scrollTop<this._parentBottom&&this._scrollTop>this._fullOffset("offsetTop",this.child)-this.options.top-this._mindtop())return!(this.options.mindViewport&&!this._isViewportAvailable())},_isViewportAvailable:function(){var t=h.getAll(this.child);return this._viewportHeight>this.child.offsetHeight+h.toFloat(t.marginTop)+h.toFloat(t.marginBottom)},_adjust:function(){var t=0,i=this._mindtop(),e=0,o=h.getAll(this.child),n=null;l&&(n=this._getContext())&&(t=Math.abs(n.getBoundingClientRect().top)),e=this._parentBottom-this._scrollTop-(this.child.offsetHeight+h.toFloat(o.marginBottom)+i+this.options.top),this.child.style.top=(e=0<e?0:e)+i+t+this.options.top-h.toFloat(o.marginTop)+"px"},_fullOffset:function(t,i,e){for(var o=i[t],n=i.offsetParent;null!==n&&n!==e;)o+=n[t],n=n.offsetParent;return o},_getContext:function(){for(var t,i=this.child,e=null;!e;){if((t=i.parentNode)===r.documentElement)return null;if("none"!==h.getAll(t)[p]){e=t;break}i=t}return e},_fix:function(){var t,i=this.child,e=i.style,o=h.getAll(i),n=i.getBoundingClientRect().left,s=o.width;this._saveStyles(),r.documentElement.currentStyle&&(s=i.offsetWidth-(h.toFloat(o.paddingLeft)+h.toFloat(o.paddingRight)+h.toFloat(o.borderLeftWidth)+h.toFloat(o.borderRightWidth))+"px"),!l||(t=this._getContext())&&(n=i.getBoundingClientRect().left-t.getBoundingClientRect().left),this._replacer.replace(),e.left=n-h.toFloat(o.marginLeft)+"px",e.width=s,e.position="fixed",e.top=this._mindtop()+this.options.top-h.toFloat(o.marginTop)+"px",this._$child.addClass(this.options.className),this.fixed=!0},_unfix:function(){var t=this.child.style;this._replacer.hide(),t.position=this._childOriginalPosition,t.top=this._childOriginalTop,t.width=this._childOriginalWidth,t.left=this._childOriginalLeft,this._$child.removeClass(this.options.className),this.fixed=!1},_saveStyles:function(){var t=this.child.style;this._childOriginalPosition=t.position,this._childOriginalTop=t.top,this._childOriginalWidth=t.width,this._childOriginalLeft=t.left},_onresize:function(){this.refresh()},_saveViewportHeight:function(){this._viewportHeight=t.innerHeight||r.documentElement.clientHeight},_stop:function(){this._unfix(),s(t).unbind("scroll",this._proxied_onscroll),s(this._toresize).unbind("resize",this._proxied_onresize)},_start:function(){this._onscroll(),s(t).bind("scroll",this._proxied_onscroll),s(this._toresize).bind("resize",this._proxied_onresize)},_destroy:function(){this._replacer.destroy()},refresh:function(){this._saveViewportHeight(),this._unfix(),this._onscroll()}}),_.prototype=new c,s.extend(_.prototype,{_start:function(){var t=h.getAll(this.child);this._childOriginalPosition=t.position,this._childOriginalTop=t.top,this.child.style.position=a,this.refresh()},_stop:function(){this.child.style.position=this._childOriginalPosition,this.child.style.top=this._childOriginalTop},refresh:function(){this.child.style.top=this._mindtop()+this.options.top+"px"}});var g=d<8?function(){return"not supported"}:function(t,i,e){return a&&!e||a&&e&&!1!==e.useNativeSticky?new _(t,i,e):f?(void 0===l&&(o=!1,n=r.createElement("div"),s=r.createElement("div"),n.appendChild(s),n.style[p]="translate(0)",n.style.marginTop="10px",n.style.visibility="hidden",s.style.position="fixed",s.style.top=0,r.body.appendChild(n),0<s.getBoundingClientRect().top&&(o=!0),r.body.removeChild(n),l=o),new u(t,i,e)):"Neither fixed nor sticky positioning supported";var o,n,s};return s.fn.fixTo=function(i,e){var o=s(i),n=0;return this.each(function(){var t=s(this).data("fixto-instance");t?t[i].call(t,e):s(this).data("fixto-instance",g(this,o[n],e)),n++})},{FixToContainer:u,fixTo:g,computedStyle:h,mimicNode:o}}(window.jQuery,window,document);