Файловый менеджер - Редактировать - /home/kunzqhe/www/wp-content/themes/themify-ultra/themify/js/modules/fixedheader.min.js
Назад
'use strict';(function(e,g){let h=!1;const k=function(){if(!h&&"undefined"!==typeof themifyScript&&themifyScript.sticky_header&&themifyScript.sticky_header.src){h=!0;const c=new Image;let b=g.getElementById("site-logo");if(b){const a=b.getElementsByTagName("a")[0];a&&(b=a)}if(b){const a=function(a){f.active=!1;b.prepend(a);setTimeout(function(){f.active=!0},310)};c.src=themifyScript.sticky_header.src;c.className="tf_sticky_logo";themifyScript.sticky_header.imgwidth&&(c.width=themifyScript.sticky_header.imgwidth); themifyScript.sticky_header.imgheight&&(c.height=themifyScript.sticky_header.imgheight);e.hasDecode?c.decode().then(function(){a(c)}):a(c)}}},f={active:!1,isTransparent:!1,headerWrap:null,type:"sticky",height:0,init(c){"object"!==typeof c&&(c={});this.headerWrap=c.headerWrap?c.headerWrap:g.getElementById("headerwrap");if(null!==this.headerWrap&&0!==this.headerWrap.length){(c.hasHeaderRevealing||e.body[0].classList.contains("revealing-header"))&&this.headerRevealing(c.revealingInvert);if(!c.disableWatch){const b= this,a=g.createElement("div");this.type=getComputedStyle(this.headerWrap).getPropertyValue("position");this.type||(this.type="static");a.className="tf_hidden tf_w";a.style.height="0";a.style.contain="strict";if(this.isTransparent=c.isTransparent?!0:"fixed"===this.type||e.body[0].classList.contains("transparent-header"))a.className+=" tf_rel",this.calculateTop(a);this.headerWrap.after(a);(new IntersectionObserver((a,c)=>{const d=a[0].boundingClientRect;(a=a[0].rootBounds)?!1===b.active&&d.bottom<a.top? b.enable():!0===b.active&&d.bottom<a.bottom&&b.disable():c.disconnect()},{threshold:[0,1]})).observe(a);"sticky"!==this.type&&"-webkit-sticky"!==this.type&&((new MutationObserver((c,f)=>{e.is_builder_active?f.disconnect():setTimeout(function(){b.calculateTop(a)},300)})).observe(this.headerWrap,{subtree:!0,childList:!0,characterData:!0}),e.on("tfsmartresize",function(){setTimeout(function(){b.calculateTop(a)},400)}),window.addEventListener("scroll",function(){b.calculateTop(a)},{passive:!0,once:!0}))}e.trigger("tf_fixed_header_ready", this.headerWrap)}},setPadding(){this.active&&0<this.height&&("relative"===this.type||"static"===this.type)&&(this.headerWrap.parentNode.style.paddingTop=this.height+"px")},calculateTop(c){let b=this.headerWrap;const a=!0===this.active&&("relative"===this.type||"static"===this.type);if(a){b=b.cloneNode(!0);var d=b.querySelector("#header");b.classList.remove("fixed-header");b.classList.add("tf_hidden","tf_opacity");b.style.position="fixed";b.style.top="-1000%";d.previousElementSibling||(d.style["margin-top"]= 0);d.nextElementSibling||(d.style["margin-bottom"]=0);this.headerWrap.parentNode.insertBefore(b,this.headerWrap)}d=b.getBoundingClientRect();this.height=d.height;if(this.isTransparent){d=d.bottom;let a=g.getElementById("wpadminbar");a&&(d-=a.offsetHeight);c.style.top=d+"px"}e.trigger("tf_fixed_header_calculate",[this.headerWrap,this.height]);a&&(b.remove(),this.setPadding())},headerRevealing(c){let b=0;const a=this,d=["scroll"],f=e.body[0].classList,g=function(){if(!1!==a.active&&b!==this.scrollY){var d= c?b<this.scrollY:b>=this.scrollY;b=this.scrollY;d||0===b||f.contains("mobile-menu-visible")||f.contains("slide-cart-visible")?a.headerWrap.classList.remove("hidden"):0<b&&!a.headerWrap.classList.contains("hidden")&&a.headerWrap.classList.add("hidden")}};e.isTouch&&(d.push("touchstart"),d.push("touchmove"));for(let a=d.length-1;-1<a;--a)window.addEventListener(d[a],g,{passive:!0});g.call(window)},enable(){!1===this.active&&(this.active=!0,k(),e.body[0].classList.add("fixed-header-on"),this.headerWrap.classList.add("fixed-header"), this.setPadding())},disable(){!0===this.active&&(this.active=!1,e.body[0].classList.remove("fixed-header-on"),this.headerWrap.classList.remove("fixed-header"),0<this.height&&("relative"===this.type||"static"===this.type)&&(this.headerWrap.parentNode.style.paddingTop=""))}};e.on("tf_fixed_header_init",function(c){!1===e.is_builder_active&&f.init(c)}).on("tf_fixed_header_enable",function(){!1===e.is_builder_active&&f.enable()}).on("tf_fixed_header_disable",function(){f.disable()}).on("tf_fixed_header_remove_revelaing", function(){null!==f.headerWrap&&f.headerWrap.classList.remove("hidden")})})(Themify,document);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка