Файловый менеджер - Редактировать - /home/digitalm/www/zetaworks/wp-content/themes/uncode/library/js/onePage.min.js
Назад
(function($){"use strict";UNCODE.onePage=function(isMobile){function init_onepage(){isSectionscroller&&!isMobile&&!$("body").hasClass("uncode-scroll-no-dots")&&!UNCODE.isFullPageSnap&&$("<ul class='onepage-pagination'></ul>").prependTo("body"),last=$(".onepage-pagination li").last().find("a").data("index"),$.each($("div[data-parent=true]"),function(index,val){$(this).attr("data-section",index);if(isMobile)return;if(UNCODE.isUnmodalOpen&&!val.closest("#unmodal-content"))return;var sectionDown=new Waypoint({context:UNCODE.isUnmodalOpen?document.getElementById("unmodal-content"):window,element:val,handler:function(direction){direction=="down"&&changeMenuActive(this.element,index)},offset:function(){return 5+getOffset()}}),sectionUp=new Waypoint({context:UNCODE.isUnmodalOpen?document.getElementById("unmodal-content"):window,element:val,handler:function(direction){direction=="up"&&changeMenuActive(this.element,index)},offset:function(){return-5-getOffset()}});if(isSectionscroller){var label;$(this).attr("data-label")!=undefined?label=$(this).attr("data-label"):label="";var getName=$(this).attr("data-name");getName==undefined&&(getName=index),label!=""&&(isOnePage=!0,label='<span class="cd-label style-accent-bg border-accent-color">'+label+"</span>",$("ul.onepage-pagination").append("<li><a class='one-dot-link' data-index='"+index+"' href='#"+getName+"'><span class='cd-dot-cont'><span class='cd-dot'></span></span>"+label+"</a></li>"))}}),isSectionscroller&&$.each($("ul.onepage-pagination li"),function(index,val){var $this=$(val);$this.on("click",function(evt){$("body").hasClass("uncode-scroll-no-history")&&evt.preventDefault(),Waypoint.refreshAll();var el=$("a",evt.currentTarget);current=lastScrolled=parseInt(el.attr("data-index")),lastScrolled+=1,scrollBody(current)})});var goToSection=parseInt(window.location.hash.replace(/[^\d.]/g,""));isNaN(goToSection)&&window.location.hash!=undefined&&window.location.hash!=""&&(goToSection=String(window.location.hash).replace(/^#/,""),goToSection=Number($("[data-name="+goToSection+"]").attr("data-section"))),typeof goToSection=="number"&&!isNaN(goToSection)&&(current=lastScrolled=goToSection,$(window).on("load",function(){$(".owl-carousel").length?requestTimeout(function(){scrollBody(goToSection)},400):scrollBody(goToSection)}))}function changeMenuActive(section,index){current=lastScrolled=parseInt($(section).attr("data-section"));if(isOnePage){var newSection=$(".onepage-pagination li a[data-index="+index+"]");newSection.length&&($("ul.onepage-pagination li a").removeClass("is-selected"),newSection.addClass("is-selected"));var getName=$("[data-section="+index+"]").attr("data-name");getName!=undefined&&getName!==""&&$.each($(".menu-container .menu-item > a, .widget_nav_menu .menu-smart .menu-item > a"),function(i,val){var get_href=$(val).attr("href");get_href!=undefined&&get_href.substring(get_href.indexOf("#")+1)==getName&&($(val).closest(".menu-smart").find(".active").removeClass("active"),$(val).parent().addClass("active"))})}}var current=0,last=0,lastScrollTop=0,forceScroll=!1,lastScrolled=0,isSectionscroller=$(".main-onepage").length?!0:!1,isOnePage=!1,getOffset=function(){var calculateOffset=$(".menu-sticky .menu-container:not(.menu-hide)").length&&$(window).width()>UNCODE.mediaQuery?$(".menu-sticky .menu-container:not(.menu-hide)").outerHeight():0;return calculateOffset};isOnePage&&$(window).on("scroll",function(){var bodyTop=document.documentElement.scrollTop||document.body.scrollTop;if(bodyTop==0){$("ul.onepage-pagination li a").removeClass("is-selected"),$(".onepage-pagination li a[data-index=0]").addClass("is-selected");var getName=$("[data-section=0]").attr("data-name");getName!=undefined&&getName!==""&&$.each($(".menu-container .menu-item > a"),function(i,val){var get_href=$(val).attr("href");get_href!=undefined&&get_href.substring(get_href.indexOf("#")+1)==getName&&($(val).closest("ul").find(".active").removeClass("active"),$(val).parent().addClass("active"))})}else if(window.innerHeight+bodyTop>=$(".box-container").height()){var lastSection=$('.onepage-pagination li a[data-index="'+last+'"]');lastSection.length&&($("ul.onepage-pagination li a").removeClass("is-selected"),lastSection.addClass("is-selected"))}});var scrollBody=function(index){$("ul.onepage-pagination li a").removeClass("is-selected"),$(".onepage-pagination li a[data-index="+index+"]").addClass("is-selected");var getSection=$("[data-section="+index+"]"),scrollTo;if(getSection==undefined)return;var body=$("html, body"),bodyTop=document.documentElement.scrollTop||document.body.scrollTop,delta=bodyTop-($("[data-section="+index+"]").length?$("[data-section="+index+"]").offset().top:0),getOffset=UNCODE.get_scroll_offset(index);if(typeof getSection.offset()=="undefined")return;scrollTo=getSection.offset().top;var shrink=typeof $(".navbar-brand").data("padding-shrink")!="undefined"?$(".navbar-brand").data("padding-shrink")*2:36;$(".menu-sticky .menu-container:not(.menu-hide)").length&&$(".menu-shrink").length&&(scrollTo+=UNCODE.menuHeight-($(".navbar-brand").data("minheight")+shrink)),$(".menu-sticky .menu-container:not(.menu-hide)").length&&!$(".menu-shrink").length&&$(".body").hasClass("vmenu")?index===0?scrollTo=0:scrollTo-=$(".menu-sticky .menu-container").outerHeight():scrollTo-=getOffset;var scrollSpeed=SiteParameters.constant_scroll=="on"?Math.abs(delta)/parseFloat(SiteParameters.scroll_speed):SiteParameters.scroll_speed;scrollSpeed<1e3&&SiteParameters.constant_scroll=="on"&&(scrollSpeed=1e3),index!=0&&(UNCODE.scrolling=!0),scrollSpeed==0?(body.scrollTop(delta>0?scrollTo-.1:scrollTo),UNCODE.scrolling=!1):body.animate({scrollTop:delta>0?scrollTo-.1:scrollTo},scrollSpeed,"easeInOutQuad",function(){requestTimeout(function(){UNCODE.scrolling=!1,getOffset!=UNCODE.get_scroll_offset(index)&&scrollBody(index)},100)})};init_onepage()}})(jQuery)
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Генерация страницы: 0.03 |
proxy
|
phpinfo
|
Настройка