1(function(factory){typeof define=="function"&&define.amd?define(["jquery"],factory):typeof module=="object"&&module.exports?module.exports=factory(require("jquery")):factory(jQuery)})(function($){var slice=Array.prototype.slice,splice=Array.prototype.splice,defaults={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",widthFromWrapper:!0,responsiveWidth:!1,zIndex:"inherit"},$window=$(window),$document=$(document),sticked=[],windowHeight=$window.height(),scroller=function(){for(var scrollTop=$window.scrollTop(),documentHeight=$document.height(),dwh=documentHeight-windowHeight,extra=scrollTop>dwh?dwh-scrollTop:0,i=0,l=sticked.length;i<l;i++){var s=sticked[i],elementTop=s.stickyWrapper.offset().top,etse=elementTop-s.topSpacing-extra;if(s.stickyWrapper.css("height",s.stickyElement.outerHeight()),scrollTop<=etse)s.currentTop!==null&&(s.stickyElement.css({width:"",position:"",top:"","z-index":""}),s.stickyElement.parent().removeClass(s.className),s.stickyElement.trigger("sticky-end",[s]),s.currentTop=null);else{var newTop=documentHeight-s.stickyElement.outerHeight()-s.topSpacing-s.bottomSpacing-scrollTop-extra;if(newTop<0?newTop=newTop+s.topSpacing:newTop=s.topSpacing,s.currentTop!==newTop){var newWidth;s.getWidthFrom?(padding=s.stickyElement.innerWidth()-s.stickyElement.width(),newWidth=$(s.getWidthFrom).width()-padding||null):s.widthFromWrapper&&(newWidth=s.stickyWrapper.width()),newWidth==null&&(newWidth=s.stickyElement.width()),s.stickyElement.css("width",newWidth).css("position","fixed").css("top",newTop).css("z-index",s.zIndex),s.stickyElement.parent().addClass(s.className),s.currentTop===null?s.stickyElement.trigger("sticky-start",[s]):s.stickyElement.trigger("sticky-update",[s]),s.currentTop===s.topSpacing&&s.currentTop>newTop||s.currentTop===null&&newTop<s.topSpacing?s.stickyElement.trigger("sticky-bottom-reached",[s]):s.currentTop!==null&&newTop===s.topSpacing&&s.currentTop<newTop&&s.stickyElement.trigger("sticky-bottom-unreached",[s]),s.currentTop=newTop}var stickyWrapperContainer=s.stickyWrapper.parent(),unstick=s.stickyElement.offset().top+s.stickyElement.outerHeight()>=stickyWrapperContainer.offset().top+stickyWrapperContainer.outerHeight()&&s.stickyElement.offset().top<=s.topSpacing;unstick?s.stickyElement.css("position","absolute").css("top","").css("bottom",0).css("z-index",""):s.stickyElement.css("position","fixed").css("top",newTop).css("bottom","").css("z-index",s.zIndex)}}},resizer=function(){windowHeight=$window.height();for(var i=0,l=sticked.length;i<l;i++){var s=sticked[i],newWidth=null;s.getWidthFrom?s.responsiveWidth&&(newWidth=$(s.getWidthFrom).width()):s.widthFromWrapper&&(newWidth=s.stickyWrapper.width()),newWidth!=null&&s.stickyElement.css("width",newWidth)}},methods={init:function(options){return this.each(function(){var o=$.extend({},defaults,options),stickyElement=$(this),stickyId=stickyElement.attr("id"),wrapperId=stickyId?stickyId+"-"+defaults.wrapperClassName:defaults.wrapperClassName,wrapper=$("<div></div>").attr("id",wrapperId).addClass(o.wrapperClassName);stickyElement.wrapAll(function(){if($(this).parent("#"+wrapperId).length==0)return wrapper});var stickyWrapper=stickyElement.parent();o.center&&stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"}),stickyElement.css("float")==="right"&&stickyElement.css({float:"none"}).parent().css({float:"right"}),o.stickyElement=stickyElement,o.stickyWrapper=stickyWrapper,o.currentTop=null,
1sticked.push(o),methods.setWrapperHeight(this),methods.setupChangeListeners(this)})},setWrapperHeight:function(stickyElement){var element=$(stickyElement),stickyWrapper=element.parent();stickyWrapper&&stickyWrapper.css("height",element.outerHeight())},setupChangeListeners:function(stickyElement){if(window.MutationObserver){var mutationObserver=new window.MutationObserver(function(mutations){(mutations[0].addedNodes.length||mutations[0].removedNodes.length)&&methods.setWrapperHeight(stickyElement)});mutationObserver.observe(stickyElement,{subtree:!0,childList:!0})}else window.addEventListener?(stickyElement.addEventListener("DOMNodeInserted",function(){methods.setWrapperHeight(stickyElement)},!1),stickyElement.addEventListener("DOMNodeRemoved",function(){methods.setWrapperHeight(stickyElement)},!1)):window.attachEvent&&(stickyElement.attachEvent("onDOMNodeInserted",function(){methods.setWrapperHeight(stickyElement)}),stickyElement.attachEvent("onDOMNodeRemoved",function(){methods.setWrapperHeight(stickyElement)}))},update:scroller,unstick:function(options){return this.each(function(){for(var that=this,unstickyElement=$(that),removeIdx=-1,i=sticked.length;i-- >0;)sticked[i].stickyElement.get(0)===that&&(splice.call(sticked,i,1),removeIdx=i);removeIdx!==-1&&(unstickyElement.unwrap(),unstickyElement.css({width:"",position:"",top:"",float:"","z-index":""}))})}};window.addEventListener?(window.addEventListener("scroll",scroller,!1),window.addEventListener("resize",resizer,!1)):window.attachEvent&&(window.attachEvent("onscroll",scroller),window.attachEvent("onresize",resizer)),$.fn.sticky=function(method){if(methods[method])return methods[method].apply(this,slice.call(arguments,1));if(typeof method=="object"||!method)return methods.init.apply(this,arguments);$.error("Method "+method+" does not exist on jQuery.sticky")},$.fn.unstick=function(method){if(methods[method])return methods[method].apply(this,slice.call(arguments,1));if(typeof method=="object"||!method)return methods.unstick.apply(this,arguments);$.error("Method "+method+" does not exist on jQuery.sticky")},$(function(){setTimeout(scroller,0)})}); 2//# sourceMappingURL=/cdn/shop/t/191/assets/jquery.sticky.js.map?v=37981688503634007831764382844
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.