detectmobilebrowser.js
7 years ago
iris-script.js
7 years ago
mystickymenu-admin.js
7 years ago
mystickymenu.js
7 years ago
mystickymenu.min.js
7 years ago
mystickymenu.min.js
1 lines
| 1 | !function(e){"use strict";jQuery(document).ready(function(e){if(jQuery.browser.mobile&&!option.device_mobile)return!1;if(!jQuery.browser.mobile&&!option.device_desktop)return!1;if(e(option.mystickyClass)[0]){var t,i=document.querySelector(option.mystickyClass),o=parseInt(option.disableWidth),s=parseInt(option.disableLargeWidth),n=option.mystickyTransition,d=parseInt(option.activationHeight),r=option.adminBar,a=option.mysticky_disable_down;E();for(var l=i.parentNode,c=document.createElement("div"),p=0,m=0;m<l.childNodes.length;m++)if(l.childNodes[m]==i){p=m;break}c.id="mysticky-wrap",c.appendChild(i),l.insertBefore(c,l.childNodes[p]);var f,y,u=i.parentNode,w=document.createElement("div");if(w.id="mysticky-nav",u.replaceChild(w,i),w.appendChild(i),"0"==d)var h=!0;C(),B();var v,x=0;S(),H();var L=d;N(),I();var g="scrollY"in window,b=0;document.addEventListener("scroll",function(e){if(t>=o&&(0==s||t<=s)){var r=g?window.scrollY:document.documentElement.scrollTop;if(0<=r){if(r>=b)r>=d&&i.classList.add("myfixed"),r>=d&&w.classList.add("wrapfixed"),r>=d&&(c.style.height=f+"px"),r>=d&&(i.style.width=v+"px"),"on"==n&&("false"==a&&(w.style.top=r>=d+y-x?x+"px":"-"+y+"px"),f>y&&"false"==a&&(r<d+y&&(w.style.top="-"+f+"px"),r>=d+y&&(w.style.top=x+"px"))),w.classList.add("down"),w.classList.remove("up"),"on"==a&&(w.style.top="-"+(f+x)+"px");else{var l=g?window.scrollY:document.documentElement.scrollTop;!(l>L)&&(c.style.height=""),!(l>L)&&(i.style.width=""),"on"==n?(!(l>L)&&i.classList.remove("myfixed"),!(l>L)&&w.classList.remove("wrapfixed"),"false"==a&&l<L+y+200-x&&(w.style.top="-"+y+"px")):(!(l>L)&&i.classList.remove("myfixed"),!(l>L)&&w.classList.remove("wrapfixed")),w.classList.remove("down"),w.classList.add("up"),"on"==a&&(w.style.top=x+"px")}b=r}else w.classList.remove("up")}});var k=e(window).width();window.addEventListener("resize",W),window.addEventListener("orientationchange",W)}else console.log("myStickymenu: Entered Sticky Class does not exist, change it in Dashboard / Settings / myStickymenu / Sticky Class. ");function E(e){e=window;var i="inner";"innerWidth"in window||(i="client",e=document.documentElement||document.body),t=e[i+"Width"]}function C(){f=i.offsetHeight,parseInt(e(i).css("marginBottom"))>0&&(c.style.marginBottom=e(i).css("marginBottom")),"0"==f&&e(i).children().filter(":visible").each(function(){f=e(this).outerHeight(!0)})}function B(){i.classList.add("myfixed"),"0"==(y=e(".myfixed").outerHeight())&&e(".myfixed").children().filter(":visible").each(function(){y=e(this).outerHeight(!0)}),i.classList.remove("myfixed")}function S(){x="true"==r&&t>600&&e("#wpadminbar")[0]?e("#wpadminbar").height():0,w.style.top="on"==n?"-"+y+"px":x+"px"}function H(){var t=e(i)[0].getBoundingClientRect();v=t.width}function N(){1==h&&("on"==n&&(d=e(i).offset().top+f-x,L=e(i).offset().top+f-x,"on"==a&&(L=e(i).offset().top-x)),"fade"==n&&("false"==a&&(d=e(i).offset().top-x,L=e(i).offset().top-x),"on"==a&&(d=e(i).offset().top-x+f,L=e(i).offset().top-x)))}function I(){1==h&&f>y&&("on"==n?(L=d,"on"==a&&(L=d-y)):(d=f,L=f))}function W(){e(window).width()!=k&&(w.classList.remove("up"),w.classList.remove("down"),e(".wrapfixed")[0]?(i.classList.remove("myfixed"),w.classList.remove("wrapfixed")):(C(),i.style.removeProperty("width"),H()),E(),S(),B(),N(),I())}})}(); |