AlkantarClanX12
Current Path : /home/thanudqk/siamfreetour.com/wp-content/themes/photofocus/assets/js/ |
Current File : //home/thanudqk/siamfreetour.com/wp-content/themes/photofocus/assets/js/functions.min.js |
!function(n){var e,o,t,s;function a(){910<=window.innerWidth?(n(document.body).on("touchstart.photoFocus",function(e){n(e.target).closest(".main-navigation li").length||n(".main-navigation li").removeClass("focus")}),e.find(".menu-item-has-children > a, .page_item_has_children > a").on("touchstart.photoFocus",function(e){var o=n(this).parent("li");o.hasClass("focus")||(e.preventDefault(),o.toggleClass("focus"),o.siblings(".focus").removeClass("focus"))})):e.find(".menu-item-has-children > a, .page_item_has_children > a").unbind("touchstart.photoFocus")}n(window).on("load.photoFocus resize.photoFocus",function(){var e;"function"==typeof n.fn.owlCarousel&&(e={rtl:!!photoFocusOptions.rtl,autoHeight:!0,margin:0,items:1,nav:!0,dots:!0,autoplay:!0,autoplayTimeout:4e3,loop:!0,responsive:{0:{items:1},640:{items:1},1024:{items:1}},navText:[photoFocusOptions.iconNavPrev,photoFocusOptions.iconNavNext]},n(".main-slider").owlCarousel(e),e={rtl:!!photoFocusOptions.rtl,autoHeight:!0,margin:0,items:1,nav:!0,dots:!0,autoplay:!0,autoplayTimeout:4e3,loop:!0,responsive:{0:{items:1}},navText:[photoFocusOptions.iconNavPrev,photoFocusOptions.iconNavNext]},n(".testimonial-slider").owlCarousel(e)),"function"==typeof n.fn.matchHeight&&n("#services-section .hentry-inner").matchHeight(),(n("body").hasClass("has-custom-header")||n("body").hasClass("absolute-header"))&&(headerheight=n("#masthead").height(),n(".navigation-default #primary-menu-wrapper .menu-inside-wrapper").css("top",headerheight)),headerheight=n("#masthead").height(),n(window).width()<1024?n("#primary-menu-wrapper .menu-inside-wrapper").css("top",headerheight):n("#primary-menu-wrapper .menu-inside-wrapper").css("top",""),n.isFunction(n.fn.masonry)&&(($blocks=n(".grid")).imagesLoaded(function(){$blocks.masonry({itemSelector:".grid-item",columnWidth:".grid-item",transitionDuration:"1s"}),n(".grid-item").fadeIn(),$blocks.find(".grid-item").animate({opacity:1})}),n(function(){setTimeout(function(){$blocks.masonry()},2e3)}),n(window).on("resize",function(){$blocks.masonry()}))}),n(function(){n(window).on("scroll",function(){100<n(this).scrollTop()?(n("#scrollup").fadeIn("slow"),n("#scrollup").show()):(n("#scrollup").fadeOut("slow"),n("#scrollup").hide())}),n("#scrollup").on("click",function(){return n("body, html").animate({scrollTop:0},500),!1}),"function"==typeof n.fn.fitVids&&n(".hentry, .widget").fitVids()}),n(document).on("wp-custom-header-video-loaded",function(){n("body").addClass("has-header-video")}),n(function(){n(document).ready(function(){var e;!0==((e=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===("undefined"!=typeof SVGRect&&e.firstChild&&e.firstChild.namespaceURI))&&(document.documentElement.className=document.documentElement.className.replace(/(\s*)no-svg(\s*)/,"$1svg$2"))})}),n(".search-toggle").on("click",function(){n(this).toggleClass("open"),n(this).attr("aria-expanded","false"===n(this).attr("aria-expanded")?"true":"false"),n(".search-wrapper").toggle()}),o=n(".main-navigation"),t=n("<button />",{class:"dropdown-toggle","aria-expanded":!1}).append(photoFocusOptions.dropdownIcon).append(n("<span />",{class:"screen-reader-text",text:photoFocusOptions.screenReaderText.expand})),o.find(".menu-item-has-children > a, .page_item_has_children > a").after(t),o.find(".current-menu-ancestor > button").addClass("toggled-on"),o.find(".current-menu-ancestor > .sub-menu").addClass("toggled-on"),o.find(".menu-item-has-children, .page_item_has_children").attr("aria-haspopup","true"),o.find(".dropdown-toggle").on("click",function(e){var o=n(this),t=o.find(".screen-reader-text");e.preventDefault(),o.toggleClass("toggled-on"),o.attr("aria-expanded","false"===o.attr("aria-expanded")?"true":"false"),t.text(t.text()===photoFocusOptions.screenReaderText.expand?photoFocusOptions.screenReaderText.collapse:photoFocusOptions.screenReaderText.expand)}),t=n("#masthead"),o=t.find(".menu-toggle"),t.find("#site-header-menu"),e=t.find("#site-navigation"),t=t.find("#social-navigation"),n(".below-site-header").prepend('<div class="overlay">'),s=0,o.length&&(o.on("click.photoFocus",function(){n(this).add(e).attr("aria-expanded","false"===n(this).add(e).attr("aria-expanded")?"true":"false")}),o.add(e).attr("aria-expanded","false"),o.add(t).attr("aria-expanded","false"),o.on("click.photoFocus",function(){var e=n(this).parents(".menu-wrapper"),e=(n(".menu-toggle").not(this).removeClass("selected"),n(".menu-wrapper").not(e).removeClass("is-open"),n(this).toggleClass("selected"),n(e).toggleClass("is-open"),n(e).hasClass("is-open"));e&&!jQuery("body").hasClass("menu-open")?(0===s&&(s=n("body").scrollTop()),n("body").addClass("menu-open")):e||(n("body").removeClass("menu-open"),n("body").scrollTop(s),s=0)}),n(document).on("click touchstart",function(){n("body").removeClass("menu-open"),n(".menu-toggle").removeClass("selected"),n(".menu-wrapper").removeClass("is-open")}),n(".site-header-menu,.menu-toggle, .dropdown-toggle, .search-field, #site-navigation, #social-search-wrapper, #social-navigation .search-submit").on("click touchstart",function(e){e.stopPropagation()})),e.length&&e.children().length&&("ontouchstart"in window&&(n(window).on("resize.photoFocus",a),a()),e.find("a").on("focus.photoFocus blur.photoFocus",function(){n(this).parents(".menu-item").toggleClass("focus")}),n(".main-navigation button.dropdown-toggle").on("click",function(){n(this).toggleClass("active"),n(this).parent().find(".children, .sub-menu").toggleClass("toggled-on")})),n(document).ready(function(){n(".toggle-top").on("click",function(e){n(this).toggleClass("toggled-on")}),n("#search-toggle").on("click",function(){n("#header-menu-social, #share-toggle").removeClass("toggled-on"),n("#header-search-container").toggleClass("toggled-on")}),n("#share-toggle").on("click",function(e){e.stopPropagation(),n("#header-search-container, #search-toggle").removeClass("toggled-on"),n("#header-menu-social").toggleClass("toggled-on")})}),n(window).on("scroll",function(){0<n(this).scrollTop()?n("#sticky-playlist-section").addClass("solid-bg-active"):n("#sticky-playlist-section").removeClass("solid-bg-active")}),n("body").on("click touch",".scroll-down",function(e){var o=n(this).parents(".section, .custom-header").next().attr("class").split(" "),o=n("."+o[0]).offset().top;n("html, body").animate({scrollTop:o},1e3)}),jQuery(document).ready(function(){jQuery(document.body),jQuery(window).on("load.photofocus resize.photofocus",function(){window.innerWidth<1024&&jQuery("#primary-menu-wrapper").on("focusout",function(){var e=jQuery(this);setTimeout(function(){e.find(":focus").length||jQuery("#primary-menu-wrapper .menu-toggle").trigger("click")},0)}),jQuery("#social-menu-wrapper .menu-inside-wrapper").on("focusout",function(){var e=jQuery(this);setTimeout(function(){e.find(":focus").length||jQuery("#share-toggle").trigger("click")},0)}),jQuery("#primary-search-wrapper .menu-inside-wrapper").on("focusout",function(){var e=jQuery(this);setTimeout(function(){e.find(":focus").length||jQuery("#search-toggle").trigger("click")},0)})})})}(jQuery);