1/** 2 * Theme Custom JS File 3 * 4 * @package Travel_Log 5 * 6 * @since 1.0.0 7 */ 8 9jQuery(function($) { 10 11 function showPage() { 12 13 var loaderState = travel_log.loader_disable 14 15 if (true != loaderState) { 16 17 document.getElementById("onload").style.display = "none"; 18 19 } 20 } 21 showPage(); 22 23 // Toggle Social Share 24 25 $('.share-toggle').click(function(event) { 26 27 $(this).siblings('.social-reveal').toggleClass('social-reveal-active'); 28 29 $(this).toggleClass('share-expanded'); 30 31 }); 32 33}); 34 35jQuery(function($) { 36 37 var rtl = false; 38 39 if (travel_log.locale_dir) { 40 var rtl = true; 41 } 42 43 console.log(rtl); 44 45 $(".travel-banner").slick({ 46 autoplay: true, 47 autoplaySpeed: 4500, 48 dots: true, 49 arrows: true, 50 infinite: true, 51 cssEase: 'ease-out', 52 useTransform: true, 53 slidesToShow: 1, 54 slidesToScroll: 1, 55 speed: travel_log.home_slider_speed, 56 rtl: rtl, 57 }); 58 59 // init Isotope 60 var $grid = $('#tourlist').isotope({ 61 // options 62 itemSelector: '.filtr-item', 63 layoutMode: 'fitRows' 64 }); 65 // filter items on button click 66 $('.filter').on('click', function() { 67 var filterValue = $(this).attr('data-filter'); 68 $grid.isotope({ filter: filterValue }); 69 }); 70 71 //Simple filter controls 72 $('.post-filter-controls li').click(function() { 73 $('.post-filter-controls li span').removeClass('active'); 74 $(this).children('span').addClass('active'); 75 }); 76 77 78 79 $(".blog-slide, .recomended-lists").slick({ 80 81 autoplay: false, 82 autoplaySpeed: 4500, 83 dots: false, 84 arrows: true, 85 infinite: true, 86 cssEase: 'ease-out', 87 useTransform: true, 88 slidesToShow: 3, 89 slidesToScroll: 1, 90 responsive: [{ 91 breakpoint: 1024, 92 settings: { 93 slidesToShow: 3, 94 slidesToScroll: 3, 95 infinite: true, 96 dots: true 97 } 98 }, 99 { 100 breakpoint: 768, 101 settings: { 102 slidesToShow: 2, 103 slidesToScroll: 2 104 } 105 }, 106 { 107 breakpoint: 481, 108 settings: { 109 slidesToShow: 1, 110 slidesToScroll: 1 111 } 112 } 113 // You can unslick at a given breakpoint now by adding: 114 // settings: "unslick" 115 // instead of a settings object 116 ], 117 speed: travel_log.home_latest_posts_speed, 118 rtl: rtl, 119 }); 120 121 $(".testimonial-wrapper .testimonial").slick({ 122 autoplay: true, 123 autoplaySpeed: 4500, 124 dots: true, 125 arrows: true, 126 infinite: true, 127 cssEase: 'linear', 128 useTransform: true, 129 slidesToShow: 1, 130 slidesToScroll: 1, 131 speed: travel_log.home_testimonial_speed, 132 fade: true, 133 rtl: rtl, 134 }); 135 136 //sider menu min mobile 137 $('#simple-menu').sidr({ 138 name: 'sidr-main', 139 side: travel_log.sidr_side, 140 source: '.sidr.right' 141 }); 142 $.sidr('close', 'sidr-main'); 143 //append a span to dropdown sidr menu and click action 144 $(".sidr-class-menu-item-has-children").append("<span class='dropdown-children'></span>"); 145 $('.sidr-class-sub-menu').slideUp(); 146 $('.dropdown-children').addClass('before') 147 $('.dropdown-children').click(function() { 148 $(this).prev('ul').slideToggle(); 149 $(this).toggleClass('before after', 15000); 150 }); 151 //collapse other dropdown menu 152 $('.dropdown-children').click(function() { 153 $(this).parent('li').siblings('li').find('ul').slideUp(); 154 $(this).parent('li').siblings('li').find('span').removeClass('after').addClass('before'); 155 }); 156 //hide sidr menu if click in body 157 $("#page").on("click", function(e) { 158 $.sidr('close', 'sidr-main'); 159 });
160 $("#sidr-main").on("click", function(e) { 161 e.stopPropagation(); 162 }); 163 164 //end 165 166 //mobile menu append top header when device width is less than 992px 167 var topHeaderSmallScreen = function() { 168 if (window.matchMedia('(max-width: 991px)').matches) { 169 $('.top-header').appendTo('.sidr .sidr-inner'); 170 $('.top-header col-sm-6').css('width', 'auto'); 171 $('.sidr-inner').find('.container').addClass('supply-container').removeClass('container'); 172 $('.sidr-inner').find('.row').addClass('supply-row').removeClass('row'); 173 $('.sidr-inner').find('.col-sm-6').removeClass('col-sm-6').addClass('top-header-row'); 174 } else { 175 176 $('.top-header').insertAfter('a.skip-link'); 177 $('.top-header col-sm-6').css('width', ''); 178 $('.supply-container').addClass('container').removeClass('supply-container'); 179 $('.supply-row').addClass('row').removeClass('supply-row'); 180 $('.top-header:nth-child(3)').addClass('col-sm-6').removeClass('top-header-row'); 181 182 } 183 } 184 topHeaderSmallScreen(); 185 $(window).resize(topHeaderSmallScreen); 186 187 //hide sidr menu if click in body 188 $(document).ready(function() { 189 $("#page").on("click", function(e) { 190 $.sidr('close', 'sidr-right'); 191 }); 192 $("#simple-menu").on("click", function(e) { 193 e.stopPropagation(); 194 }); 195 }); 196 //end 197 198 // ===== Scroll to Top ==== 199 $(window).scroll(function() { 200 if ($(this).scrollTop() >= 100) { // If page is scrolled more than 50px 201 $('#return-to-top').fadeIn(200); // Fade in the arrow 202 } else { 203 $('#return-to-top').fadeOut(200); // Else fade out the arrow 204 } 205 }); 206 $('#return-to-top').click(function(e) { 207 208 e.preventDefault(); 209 210 // When arrow is clicked 211 $('body,html').animate({ 212 scrollTop: 0 // Scroll to top of body 213 }, 500); 214 }); 215 216 217 // ===== Equel Height JS ==== 218 equalheight = function(container) { 219 220 var currentTallest = 0, 221 currentRowStart = 0, 222 rowDivs = new Array(), 223 $el, 224 topPosition = 0; 225 $(container).each(function() { 226 227 $el = $(this); 228 $($el).height('auto') 229 topPostion = $el.position().top; 230 231 if (currentRowStart != topPostion) { 232 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 233 rowDivs[currentDiv].height(currentTallest); 234 } 235 rowDivs.length = 0; // empty the array 236 currentRowStart = topPostion; 237 currentTallest = $el.height(); 238 rowDivs.push($el); 239 } else { 240 rowDivs.push($el); 241 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 242 } 243 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 244 rowDivs[currentDiv].height(currentTallest); 245 } 246 }); 247 } 248 249 $(window).load(function() { 250 equalheight('.blog-slide .blog-latest-post .post-content'); 251 }); 252 253 254 $(window).resize(function() { 255 equalheight('.blog-slide .blog-latest-post .post-content'); 256 }); 257 258 //search-form 259 260 $('a[href="#search-form"]').on('click', function(event) { 261 262 event.preventDefault(); 263 264 $('#header-search #search-form').addClass('open'); 265 266 // $('#search-form input[type="search"]').focus(); 267 268 }); 269 270 $('#header-search #search-form span.close').click(function(event) { 271 272 $('#header-search #search-form').removeClass('open'); 273 274 }); 275 276 var $links = $('.widget_media_gallery .gallery-icon a'); 277 278 $links.on('click', function() { 279 280 $.fancybox.open($links, { 281 // Custom options 282 }, $links.index(this)); 283 284 return false; 285 }); 286 287});
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.