whoami7 - Manager
:
/
home
/
topsuzmw
/
www
/
wp-content
/
themes
/
pixwell
/
assets
/
js
/
Upload File:
files >> /home/topsuzmw/www/wp-content/themes/pixwell/assets/js/rbsticky.min.js
/** ruby sticky sidebar */ ;var RubyStickySidebar=function(t,o){"use strict";return t.$sections=[],t.$lastHeight=0,t.$delay=1,t.$isEnabled=!1,t.$topSpacing=0,t.$smartSticky=!1,t.$wHeight=o(window).height(),t.$scrolling="down",t.init=function(){var t=this;t.topSpacing(),t.reCalcSections(),window.addEventListener?(window.addEventListener("scroll",function(){clearTimeout(t.lastScrollEvent),t.$delay%2==1?(t.checkEventScroll(),t.$delay=1):t.$delay++,t.lastScrollEvent=setTimeout(function(){t.reCalcSections(),t.checkEventScroll()},30)},!1),window.addEventListener("resize",function(){t.reload()},!1)):window.attachEvent&&(window.attachEvent("onscroll",function(){clearTimeout(t.lastScrollEvent),t.$delay%2==1?(t.checkEventScroll(),t.$delay=1):t.$delay++,t.lastScrollEvent=setTimeout(function(){t.reCalcSections(),t.checkEventScroll()},30)}),window.attachEvent("onresize",function(){t.reload()}))},t.topSpacing=function(){var t=o("body");t.hasClass("smart-sticky")&&(this.$smartSticky=!0);var n=0,e=0;o("#wpadminbar").length&&(n=o("#wpadminbar").height()),t.hasClass("sticky-nav")&&o(".navbar-wrap")&&(e=o(".navbar-wrap").height()),this.$topSpacing=e+n},t.stick=function(t){var n=this;991>o(window).width()?(n.$isEnabled=!1,n.restoreCSS()):n.$isEnabled=!0,t.length>0&&t.each(function(){var t=o(this);n.addSection(t)}),n.init()},t.addSection=function(t){var o=this.createSection(t);void 0!==o&&(this.addClearFix(o),o.contentTop=0,o.contentBottom=0,o.sidebarTop=0,o.sidebarBottom=0,o.status="top_content",this.sectionPos(o),this.$sections.push(o))},t.createSection=function(t){var o={};if(o.sidebar=t.find(".sidebar-inner"),o.content=t.parent().find(".rbc-content"),void 0!==o.content)return o},t.addClearFix=function(t){t.content.parent().addClass("clearfix"),t.sidebar.after('<div class="clearfix"></div>')},t.sectionPos=function(t){return t.contentTop=t.content.offset().top,t.contentHeight=t.content.height(),t.contentBottom=t.contentTop+t.contentHeight,t.sidebarHeight=t.sidebar.height()+this.$topSpacing,t.sidebarWidth=t.sidebar.parent().width(),t},t.sidebarPos=function(t){return t.sidebarTop=t.sidebar.offset().top,t.sidebarBottom=t.sidebarTop+t.sidebarHeight,t},t.sectionStatus=function(t,o){var n=this.$scrolling,e=this.$wHeight+o;return t.sidebarHeight+60>=t.contentHeight?t.status="content_small":t.sidebarHeight<=this.$wHeight?o<t.contentTop?t.status="top_content":t.contentBottom-t.sidebarHeight>=o?(t.status="fixed_top",t.scrollStatus=n):t.status="bottom_content":(t.sidebarBottom<o?t.status="bottom_content":t.sidebarBottom<=e&&t.sidebarBottom<t.contentBottom&&"down"==n&&t.contentBottom>e?t.status="fixed_bottom":t.sidebarTop<=t.contentTop&&"up"==n&&t.contentBottom>=e?t.status="top_content":t.contentBottom<=t.sidebarBottom&&"down"==n||t.contentBottom<e?t.status="bottom_content":o<=t.sidebarTop&&"up"==n&&t.contentTop<=o&&(t.status="fixed_top"),("up"==n&&"fixed_bottom"==t.status||"fixed_top"==t.status&&"down"==n)&&(t.status="absolute")),t.status},t.checkEventScroll=function(){if(this.$isEnabled){var n=o(window).scrollTop();n!=this.$lastHeight&&n>this.$lastHeight?this.$scrolling="down":n!=this.$lastHeight&&n<this.$lastHeight&&(this.$scrolling="up"),this.$lastHeight=n;for(var e=0;e<this.$sections.length;e++){var i=this.$sections[e];this.sidebarPos(i),i.status=this.sectionStatus(i,n),t.calcCSS(i)}}},t.restoreCSS=function(){for(var t=0;t<this.$sections.length;t++)this.$sections[t].sidebar.css({width:"auto",position:"static",top:"auto",bottom:"auto"})},t.calcCSS=function(t){switch(t.status){case"fixed_bottom":if(!0===t.fixed_bottom_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!0,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!1,t.sidebar.css({width:t.sidebarWidth,position:"fixed",top:"auto",bottom:"0","z-index":"100"});break;case"top_content":if(!0===t.top_content_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!0,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!1,t.sidebar.css({width:"auto",position:"static",top:"auto",bottom:"auto"});break;case"bottom_content":if(!0===t.bottom_content_run_once&&t.bottom_content_last_sidebar_height==t.sidebarHeight&&t.bottom_content_last_content_height==t.contentHeight)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!0,t.absolute_run_once=!1,t.content_small_run_once=!1,t.bottom_content_last_sidebar_height=t.sidebarHeight,t.bottom_content_last_content_height=t.contentHeight,t.sidebar.css({width:t.sidebarWidth,position:"absolute",top:t.contentBottom-t.sidebarHeight-t.contentTop+this.$topSpacing,bottom:"auto"});break;case"fixed_top":if(!0===t.fixed_top_run_once)break;t.fixed_top_run_once=!0,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!1,t.sidebar.css({width:t.sidebarWidth,position:"fixed",top:0+this.$topSpacing,bottom:"auto"}),this.$smartSticky&&t.scrollStatus&&"down"==t.scrollStatus&&t.sidebar.css("top","0");break;case"absolute":if(!0===t.absolute_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!0,t.content_small_run_once=!1,t.sidebar.css({width:t.sidebarWidth,position:"absolute",top:t.sidebarTop-t.contentTop+this.$topSpacing,bottom:"auto"});break;case"content_small":if(!0===t.content_small_run_once)break;t.fixed_top_run_once=!1,t.fixed_bottom_run_once=!1,t.top_content_run_once=!1,t.bottom_content_run_once=!1,t.absolute_run_once=!1,t.content_small_run_once=!0,t.sidebar.css({width:"auto",position:"static",top:"auto",bottom:"auto"})}},t.resetFlags=function(){for(var t=0;t<this.$sections.length;t++)this.$sections[t].fixed_top_run_once=!1,this.$sections[t].fixed_bottom_run_once=!1,this.$sections[t].top_content_run_once=!1,this.$sections[t].bottom_content_run_once=!1,this.$sections[t].absolute_run_once=!1,this.$sections[t].content_small_run_once=!1,this.$sections[t].bottom_content_last_sidebar_height=0,this.$sections[t].bottom_content_last_contentHeight=0},t.reload=function(){991>o(window).width()?(this.$isEnabled=!1,this.restoreCSS()):this.$isEnabled=!0},t.reCalcSections=function(){for(var t=0;t<this.$sections.length;t++)this.sectionPos(this.$sections[t])},t}(RubyStickySidebar||{},jQuery);
Copyright ©2021 || Defacer Indonesia