1"use strict"; 2 3jQuery(window).scroll(function() { 4 var wpadminbar = jQuery('#wpadminbar').outerHeight() 5 var topBarHeight = jQuery('#top-bar').outerHeight(); 6 var headerV2Height = jQuery('.header-v2').outerHeight(); 7 var headerContainer = (jQuery('.header-container')); 8 var headerHeight = headerContainer.outerHeight(); 9 if (jQuery(this).scrollTop() > headerHeight){ 10 jQuery('.sticky-tr').removeClass("transparent-header").css('top', -topBarHeight - headerV2Height); 11 jQuery('.sticky').css('top', -topBarHeight - headerV2Height + wpadminbar); 12 } 13 else{ 14 jQuery('.sticky-tr').addClass("transparent-header").css('top', 0); 15 jQuery('.sticky').css('top', 0); 16 } 17 18}); 19 20jQuery(document).ready(function($) { 21 jQuery('.header-placeholder').css('height', jQuery('.header-container').outerHeight()); 22 23 /* SHOW NAV MENU 24 ========================================================================== */ 25 26 $( '#nav-listener' ).click(function() { 27 $('body').toggleClass('active-nav-aside'); 28 }); 29 30 31 /* SHOW MINI CART 32 ========================================================================== */ 33 $( '.cart-listener' ).click(function() { 34 $('body').toggleClass('show-sub-cart'); 35 }); 36 $( '.overlay, .close-cart' ).click(function() { 37 $('body').removeClass('show-sub-cart'); 38 }); 39 40 41 42/* SMOOTH SCROLLING 43 ========================================================================== */ 44 $('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function() { 45 var target = $(this.hash); 46 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 47 if (target.length) { 48 $('html, body').animate({ 49 scrollTop: (target.offset().top - 79) 50 }, 1000 ); 51 return false; 52 } 53 }); 54 55 56 var dateElement = $('.datepicker'); 57 dateElement.datepicker({ 58 minDate: 0, 59 dateFormat: dateElement.attr('format'), 60 }); 61 $('.datepicker').datepicker( "setDate", "getDate" ); 62 $('.tabs').tabs({show: 'fade', hide: 'fade'}); 63 64 // RWD Navigation 65 function initMainNavigation( container ) { 66 // Add dropdown toggle that display child menu items. 67 container.find( '.menu-item-has-children > a' ).after( '<button class="dropdown-toggle">' + '</button>' ); 68 container.find('a[href$="#"]').addClass('dropdown-toggle').next().remove(); 69 70 71 // Toggle buttons and submenu items with active children menu items. 72 container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' ); 73 74 container.find( '.dropdown-toggle' ).click( function( e ) { 75 var _this = $( this ); 76 e.preventDefault(); 77 _this.toggleClass( 'toggle-on' ); 78 _this.next( '.children, .sub-menu' ).toggleClass( 'toggled-on' ); 79 } ); 80 } 81 initMainNavigation( $( '#nav' ) ); 82 83 84 85 86 $('.gallery').magnificPopup({ 87 delegate: 'a', 88 type: 'image', 89 gallery:{ 90 enabled:true 91 } 92 }); 93 94 var swiper = new Swiper('#testimonials-slider .swiper-container',{ 95 navigation: { 96 nextEl: '.next', 97 prevEl: '.prev', 98 }, 99 cleanupStyles: true, 100 loop: true, 101 }); 102 103 //Latest News Slider 104 var swiper = new Swiper('#latest-news .swiper-container',{ 105 navigation: { 106 nextEl: '#latest-news .slider-button-next', 107 prevEl: '#latest-news .slider-button-prev', 108 }, 109 pagination: { 110 el: '.swiper-pagination', 111 clickable: true, 112 }, 113 cleanupStyles: true, 114 autoHeight: true, 115 }); 116 117 //Swiper Promo Slider 118 var swiper = new Swiper('.promo-slider',{ 119 navigation: { 120 nextEl: '.slider-button-next', 121 prevEl: '.slider-button-prev', 122 }, 123 pagination: { 124 el: '.swiper-pagination', 125 clickable: true, 126 }, 127 cleanupStyles: true, 128 autoplay: 6000, 129 autoHeight: true, 130 }); 131 132 var swiper = new Swiper('#page-slider',{ 133 134 navigation: { 135 nextEl: '.slider-button-next', 136 prevEl: '.slider-button-prev', 137 }, 138 pagination: { 139 el: '.swiper-pagination', 140 clickable: true, 141 }, 142 cleanupStyles: true, 143 autoplay: 6000, 144 loop: true, 145 });
146 147/* TITLE SHADOW 148 ========================================================================== */ 149 $('.dynamic-shadow').okshadow({ 150 color: '#000', 151 textShadow: true, 152 }); 153 154 155/* OPEN TABLE DATE PICKER 156 ========================================================================== */ 157 var otDate = $('.otw-reservation-date'); 158 otDate.datepicker({ 159 minDate: 0, 160 dateFormat: otDate.attr('format'), 161 onSelect: function() { 162 var secconds = Date.parse(otDate.val()); 163 var date = new Date(secconds); 164 var yy = date.getFullYear(); 165 var mm = date.getMonth() + 1; 166 var dd = date.getDate(); 167 $('.startDate').val( mm + '/' + dd + '/' + yy); 168 } 169 }); 170 otDate.datepicker( 'setDate', 'getDate' ); 171 172}); 173 174/* WOOCOMMERCE CART PRODUCTS 175 ========================================================================== */ 176function cristiano_cart() { 177 var product_list, 178 cart_list, 179 removeCartButton = jQuery('.remove_from_cart_button'), 180 addToCartButton = jQuery('.ajax_add_to_cart'); 181 addToCartButton.each(function() { 182 var myThis = jQuery(this); 183 product_list = jQuery(this).attr('data-product_id'); 184 removeCartButton.each(function(){ 185 cart_list = jQuery(this).attr('data-product_id'); 186 if(product_list == cart_list) { 187 myThis.addClass('added'); 188 } 189 }); 190 }); 191 removeCartButton.click(function(){ 192 var cart_list = jQuery(this).attr('data-product_id'); 193 addToCartButton.each(function() { 194 if(cart_list == jQuery(this).attr('data-product_id')) 195 jQuery(this).removeClass('added'); 196 }); 197 }); 198} 199 200window.addEventListener('load', cristiano_cart); 201jQuery( document ).ajaxSuccess(cristiano_cart); 202 203 204window.onload = function(){ 205 if(document.getElementById('slider')) { 206 var slider = document.getElementById('slider').getElementsByClassName('item'); 207 208 if(slider.length == 1) { 209 bg_zoom(); 210 } 211 if( slider.length > 1 ) { 212 var sliderLength = slider.length; 213 var count = 0; 214 bg_switch(); 215 setInterval(bg_switch, 7000); 216 } 217 } 218 219 function bg_zoom(){ 220 slider[0].classList.add('one-bg'); 221 } 222 223 function bg_switch(){ 224 slider[count].classList.add('active'); 225 slider[count].style.zIndex = 1; 226 var scount = count; 227 228 if(scount === 0) { 229 slider[sliderLength - 1].style.removeProperty('z-index'); 230 setTimeout(function(){ 231 slider[sliderLength - 1].classList.remove('active'); 232 },3000); 233 } else { 234 slider[scount - 1].style.removeProperty('z-index'); 235 setTimeout(function(){ 236 slider[scount - 1].classList.remove('active'); 237 },3000); 238 } 239 (sliderLength === count + 1) ? count = 0 : count++; 240 } 241}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.