1/*-------------------------------------------------------------------------------------------------------------------------------*/ 2/*This is main JS file that contains custom style rules used in this template*/ 3/*-------------------------------------------------------------------------------------------------------------------------------*/ 4/* Template Name: Travel*/ 5/* Version: 1.0 Initial Release*/ 6/* Build Date: 22-04-2015*/ 7/* Author: Unbranded*/ 8/* Website: http://moonart.net.ua/site/ 9/* Copyright: (C) 2015 */ 10/*-------------------------------------------------------------------------------------------------------------------------------*/ 11 12/*--------------------------------------------------------*/ 13/* TABLE OF CONTENTS: */ 14/*--------------------------------------------------------*/ 15/* 01 - VARIABLES */ 16/* 02 - PAGE CALCULATIONS */ 17/* 03 - FUNCTION ON DOCUMENT READY */ 18/* 04 - FUNCTION ON PAGE LOAD */ 19/* 05 - FUNCTION ON PAGE RESIZE */ 20/* 06 - FUNCTION ON PAGE SCROLL */ 21/* 07 - SWIPER SLIDERS */ 22/* 08 - BUTTONS, CLICKS, HOVERS */ 23/* 09 - LIGHT-BOX */ 24 25/*-------------------------------------------------------------------------------------------------------------------------------*/ 26$(function() { 27 28 "use strict"; 29 30 31 32 /*================*/ 33 /* 01 - VARIABLES */ 34 /*================*/ 35 36 var swipers = [], winW, winH, winScr, $container, _isresponsive, xsPoint = 451, smPoint = 768, mdPoint = 992, lgPoint = 1200, addPoint = 1600, _ismobile = navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i); 37 38 /*========================*/ 39 /* 02 - PAGE CALCULATIONS */ 40 /*========================*/ 41 function pageCalculations(){ 42 winW = $(window).width(); 43 winH = $(window).height(); 44 if($('.menu-button').is(':visible')) _isresponsive = true; 45 else _isresponsive = false; 46 } 47 48 /*=================================*/ 49 /* 03 - FUNCTION ON DOCUMENT READY */ 50 /*=================================*/ 51 pageCalculations(); 52 accordionChooser(); 53 54 //center all images inside containers 55 $('.center-image').each(function(){ 56 var bgSrc = $(this).attr('src'); 57 $(this).parent().addClass('background-block').css({'background-image':'url('+bgSrc+')'}); 58 $(this).hide(); 59 }); 60 61 //sticked header 62 var $st_header = $('header'); 63 if($st_header.hasClass('header-sticked')){ 64 if ($st_header.hasClass('st-58')){ 65 $('body').addClass('st-58'); 66 } else if ($st_header.hasClass('st-100')){ 67 $('body').addClass('st-100'); 68 } else if($st_header.hasClass('st-148')){ 69 $('body').addClass('st-148'); 70 } else{ 71 $('body').addClass('stick'); 72 } 73 74 } 75 76 /*============================*/ 77 /* 04 - FUNCTION ON PAGE LOAD */ 78 /*============================*/ 79 $(window).load(function(){ 80 initFullPage(); 81 initSwiper(); 82 videoRezise(); 83 tpEntryHover(); 84 $('.loading').fadeOut(700); 85 86 $('.isotope-container').isotope({itemSelector: '.item', masonry:{gutter:0,columnWidth:'.grid-sizer'}}); 87 var initValue = $('.filter-nav').find('.selected a').attr('data-filter'); 88 $container.isotope({itemSelector: '.item', filter: initValue,masonry:{gutter:0,columnWidth:'.grid-sizer'}}); 89 90 91 92 }); 93 /*==============================*/ 94 /* 05 - FUNCTION ON PAGE RESIZE */ 95 /*==============================*/ 96 function resizeCall(){ 97 pageCalculations(); 98 videoRezise(); 99 initFullPage(); 100 updateFullPage(); 101 tpEntryHover(); 102 103 $('.swiper-container.initialized[data-slides-per-view="responsive"]').each(function(){ 104 var thisSwiper = swipers['swiper-'+$(this).attr('id')], $t = $(this), slidesPerViewVar = updateSlidesPerView($t); 105 thisSwiper.params.slidesPerView = slidesPerViewVar; 106 thisSwiper.reInit(); 107 var paginationSpan = $t.find('.pagination span'); 108 var paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar)); 109 if(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden'); 110 else $t.removeClass('pagination-hidden'); 111 paginationSlice.show(); 112 }); 113 } 114 if(!_ismobile){ 115 $(window).resize(function(){ 116 resizeCall(); 117 }); 118 } else{ 119 window.addEventListener("orientationchange", function() { 120 resizeCall(); 121 }, false); 122 } 123 124 /*=====================*/ 125 /* 07 - swiper sliders */ 126 /*=====================*/ 127 function initSwiper(){ 128 var initIterator = 0; 129 $('.swiper-container').each(function(){ 130 var $t = $(this); 131 132 var index = 'swiper-unique-id-'+initIterator; 133 134 $t.addClass('swiper-'+index + ' initialized').attr('id', index); 135 $t.find('.pagination').addClass('pagination-'+index); 136 137 var autoPlayVar = parseInt($t.attr('data-autoplay'),10); 138 var centerVar = parseInt($t.attr('data-center'),10);
139 var simVar = ($t.closest('.circle-description-slide-box').length)?false:true; 140 141 var slidesPerViewVar = $t.attr('data-slides-per-view'); 142 if(slidesPerViewVar == 'responsive'){ 143 slidesPerViewVar = updateSlidesPerView($t); 144 } 145 else slidesPerViewVar = parseInt(slidesPerViewVar,10); 146 147 var loopVar = parseInt($t.attr('data-loop'),10); 148 var speedVar = parseInt($t.attr('data-speed'),10); 149 150 var slidesPerGroup = parseInt($t.attr('data-slides-per-group'),10); 151 if(!slidesPerGroup){slidesPerGroup=1;} 152 153 swipers['swiper-'+index] = new Swiper('.swiper-'+index,{ 154 speed: speedVar, 155 pagination: '.pagination-'+index, 156 loop: loopVar, 157 paginationClickable: true, 158 autoplay: autoPlayVar, 159 slidesPerView: slidesPerViewVar, 160 slidesPerGroup: slidesPerGroup, 161 keyboardControl: true, 162 calculateHeight: true, 163 simulateTouch: simVar, 164 centeredSlides: centerVar, 165 roundLengths: true, 166 onInit: function(swiper){ 167 var browserWidthResize = $(window).width(); 168 if (browserWidthResize < 750) { 169 swiper.params.slidesPerGroup=1; 170 } else { 171 swiper.params.slidesPerGroup=slidesPerGroup; 172 } 173 }, 174 onResize: function(swiper){ 175 var browserWidthResize2 = $(window).width(); 176 if (browserWidthResize2 < 750) { 177 swiper.params.slidesPerGroup=1; 178 } else { 179 swiper.params.slidesPerGroup=slidesPerGroup; 180 swiper.resizeFix(true); 181 } 182 }, 183 onSlideChangeEnd: function(swiper){ 184 var activeIndex = (loopVar===1)?swiper.activeLoopIndex:swiper.activeIndex; 185 var qVal = $t.find('.swiper-slide-active').attr('data-val'); 186 $t.find('.swiper-slide[data-val="'+qVal+'"]').addClass('active'); 187 }, 188 onSlideChangeStart: function(swiper){ 189 $t.find('.swiper-slide.active').removeClass('active'); 190 if($t.hasClass('thumbnails-preview')){ 191 var activeIndex = (loopVar===1)?swiper.activeLoopIndex:swiper.activeIndex; 192 swipers['swiper-'+$t.next().attr('id')].swipeTo(activeIndex); 193 $t.next().find('.current').removeClass('current'); 194 $t.next().find('.swiper-slide[data-val="'+activeIndex+'"]').addClass('current'); 195 } 196 }, 197 onSlideClick: function(swiper){ 198 if($t.hasClass('thumbnails')) { 199 swipers['swiper-'+$t.prev().attr('id')].swipeTo(swiper.clickedSlideIndex); 200 } 201 } 202 }); 203 swipers['swiper-'+index].reInit(); 204 if($t.attr('data-slides-per-view')=='responsive'){ 205 var paginationSpan = $t.find('.pagination span'); 206 var paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar)); 207 if(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden'); 208 else $t.removeClass('pagination-hidden'); 209 paginationSlice.show(); 210 } 211 initIterator++; 212 }); 213 214 } 215 216 function updateSlidesPerView(swiperContainer){ 217 if(winW>=addPoint) return parseInt(swiperContainer.attr('data-add-slides'),10); 218 else if(winW>=lgPoint) return parseInt(swiperContainer.attr('data-lg-slides'),10); 219 else if(winW>=mdPoint) return parseInt(swiperContainer.attr('data-md-slides'),10); 220 else if(winW>=smPoint) return parseInt(swiperContainer.attr('data-sm-slides'),10); 221 else if(winW>=xsPoint) return parseInt(swiperContainer.attr('data-xs-slides'),10); 222 else return parseInt(swiperContainer.attr('data-mob-slides'),10); 223 } 224 225 //swiper arrows 226 $('.swiper-arrow-left').on('click',function(){ 227 swipers['swiper-'+$(this).closest('.arrows').find('.swiper-container').attr('id')].swipePrev(); 228 }); 229 $('.swiper-arrow-right').on('click',function(){ 230 swipers['swiper-'+$(this).closest('.arrows').find('.swiper-container').attr('id')].swipeNext(); 231 }); 232 233 234 235 /*==============================*/ 236 /* 06 - FUNCTION ON PAGE SCROLL */ 237 /*==============================*/ 238 $(window).scroll(function() { 239 if ($(window).scrollTop() >= 10){ 240 $('header').addClass('scrol'); 241 }else { 242 $('header').removeClass('scrol'); 243 } 244 245 246 }); 247 248 if ($(window).width()<768){ 249 250 $('.drop-tabs').on( "click", function() { 251 if($('.arrow-down').hasClass('act')){ 252 $(this).find('.arrow-down').removeClass('act');
253 $(this).find('.nav-tabs').slideUp(400); 254 255 }else{ 256 $('.drop span').slideUp(300); 257 $(this).find('.arrow-down').addClass('act'); 258 $(this).find('.nav-tabs').slideDown(400); 259 } 260 return false; 261 }); 262 263 264 265 266 $('.click-tabs').on( "click", function() { 267 var tabbIndex =$(this).index(); 268 $(this).parent().parent().parent().find('b').text($(this).text()); 269 $('.drop-tabs').find('.nav-tabs').slideUp(400); 270 $('.tab-pane').removeClass('active'); 271 $('.tab-pane').eq(tabbIndex).addClass('active'); 272 }); 273 } 274 275 276 277 function timePiker() { 278 $('.timePiker').each(function(){ 279 $('.timePiker').DateTimePicker({ 280 dateTimeFormat: "dd-MM-yyyy hh:mm:ss AA", 281 maxDateTime: "20-07-2016 12:00:00 AM", 282 minDateTime: "20-07-2012 12:00:00 AM", 283 284 285 animationDuration: 100 286 }); 287 }); 288 289 } 290 291 timePiker(); 292 293 $('.click-tabs a').on('click', function(){ 294 timePiker(); 295 }); 296 297 /***********************************/ 298 /*VIDEO CKICK*/ 299 /**********************************/ 300 301 $('.video-click').on( "click", function() { 302 $(this).find('iframe').attr('src',$(this).find('.video-change').attr('href') + '&autoplay=1'); 303 $(this).find('.video').show(); 304 $(this).find('.img-href').hide(); 305 $(this).find('.video-title').hide(); 306 }); 307 308 $('.video .close-v').on('click', function(){ 309 $('.video').fadeOut(500, function(){ 310 $('.video iframe').attr('src',''); 311 $('.img-href').show(); 312 $('.video-title').show(); 313 }); 314 }); 315 function videoRezise(){ 316 $('.video-click').find('iframe').height($('.img-href').height()); 317 } 318 319 $(document).on('click', '.video-open', function(){ 320 $('.video-player').addClass('active'); 321 var videoSource = $(this).find('img').attr('data-src'); 322 setTimeout(function(){$('.video-player iframe').attr('src', videoSource);}, 1000); 323 }); 324 325 $('.video-player .close-iframe').on('click', function(){ 326 $('.video-player iframe').attr('src', ''); 327 setTimeout(function(){$('.video-player').removeClass('active');}, 1000); 328 329 }); 330 331 $('#fullpage').on('mousewheel', function(event) { 332 console.log(event.deltaX, event.deltaY, event.deltaFactor); 333 }); 334 335 /*==============================*/ 336 /* 06 - POPUPS */ 337 /*==============================*/ 338 //search popup 339 340 $('.search .search-img').on( "click", function() { 341 $(this).siblings('.search-popup').toggleClass("active"); 342 return false; 343 }); 344 $('.s_close ').on( "click", function() { 345 $(this).parent('.search-popup').toggleClass("active"); 346 return false; 347 }); 348 349 350 //cart popup 351 $('.card-icon, .card-link').on( "click", function() { 352 $(this).siblings('.cart-popup').slideToggle(); 353 return false; 354 }); 355 $('.cart_close').on( "click", function() { 356 $(this).parent('.cart-popup').slideToggle(); 357 return false; 358 }); 359 $('.cart-popup .item-remove').on( "click", function() { 360 $(this).parents('.hotel-small').remove(); 361 return false; 362 }); 363 364 365 /*==============================*/ 366 /* 06 - TABS, DROPDOWNS, COUNTERS, DATEPIKER */ 367 /*==============================*/ 368 369 //Tabs 370 var tabFinish = 0; 371 $(document).on('click', '.nav-tab-item', function(){ 372 373 var $t = $(this); 374 if(tabFinish || $t.hasClass('active')) return false; 375 tabFinish = 1; 376 $t.closest('.nav-tab').find('.nav-tab-item').removeClass('active'); 377 $t.addClass('active'); 378 var index = $t.parent().parent().find('.nav-tab-item').index(this); 379 $t.closest('.tab-wrapper').find('.tab-info:visible').fadeOut(500, function(){ 380 $t.closest('.tab-wrapper').find('.tab-info').eq(index).fadeIn(500, function() { 381 tabFinish = 0; 382 resizeCall(); 383 setTimeout (function(){ 384 initSwiper(); 385 },500) 386 387 }); 388 }); 389 }); 390 391 $('.cat-drop').on('click', function(){ 392 var $t = $(this).parent('li'); 393 if ($t.hasClass('active')) return false; 394 /*$t.parent('.sidebar-category').find('li.active ul').slideToggle(300, function(){ 395 $(this).parent('li').removeClass('active'); 396 $t.addClass('active').find('ul').slideToggle(300); 397 });*/ 398 var $cat_active = $t.parent('.sidebar-category').find('li.active'); 399 $cat_active.removeClass('active'); 400 $cat_active.find('ul').slideToggle(); 401 $t.addClass('active').find('ul').slideToggle(); 402 403 return false;
404 }); 405 406 //Dropdown 407 $('.drop').on( "click", function() { 408 if($(this).find('.drop-list').hasClass('act')){ 409 $(this).find('.drop-list').removeClass('act'); 410 $(this).find('span').slideUp(300); 411 }else{ 412 $('.drop span').slideUp(300); 413 $('.drop .act').removeClass('act'); 414 $(this).find('.drop-list').addClass('act'); 415 $(this).find('span').slideDown(300); 416 } 417 return false; 418 }); 419 $('.drop span a').on( "click", function() { 420 $(this).parent().parent().find('b').text($(this).text()); 421 $('.drop').find('span').slideUp(300); 422 }); 423 424 /*accordion*/ 425 $('.accordion').each(function(){ 426 $(this).find('.acc-title').on("click", function(){ 427 if($(this).hasClass('active')){ 428 $(this).removeClass('active'); 429 $(this).siblings('.acc-body').slideUp(); 430 } else{ 431 $(this).closest('.accordion').find('.active').removeClass('active'); 432 $(this).closest('.accordion').find('.acc-body').slideUp('slow'); 433 $(this).toggleClass('active'); 434 $(this).siblings('.acc-body').slideToggle('slow'); 435 } 436 }); 437 }); 438 439 //accordion-chooser 440 $('.accordion-chooser a').on('click', function(){ 441 if($(this).hasClass('active')) return false; 442 var filter = $(this).data('fifter'); 443 444 var accordion = $(this).parents('.accordion-filter').find('.accordion'); 445 $(this).siblings('.active').removeClass('active'); 446 $(this).addClass('active'); 447 if (filter=="*"){ 448 accordion.find('.acc-panel').show(); 449 } else{ 450 accordion.find('.acc-panel:not('+filter+')').hide(); 451 accordion.find(filter).show(); 452 } 453 454 return false; 455 }); 456 function accordionChooser(){ 457 if($('.accordion-chooser').length){ 458 var active_filter = $('.accordion-chooser').find('a.active'); 459 var filter = active_filter.data('fifter'); 460 var accordion = active_filter.parents('.accordion-filter').find('.accordion'); 461 active_filter.siblings('.active').removeClass('active'); 462 active_filter.addClass('active'); 463 if (filter=="*"){ 464 accordion.find('.acc-panel').show(); 465 } else{ 466 accordion.find('.acc-panel:not('+filter+')').hide(); 467 accordion.find(filter).show(); 468 } 469 470 return false; 471 472 } 473 } 474 475 //counters 476 if ($('.counters').length){ 477 $('.counters').viewportChecker({ 478 classToAdd: 'counted', 479 offset: 100, 480 callbackFunction: function(elem, action){ 481 elem.find('.counter-number').countTo(); 482 } 483 }); 484 } 485 486 //Datepiker 487 if ($( ".datepicker" ).length){ 488 $( ".datepicker" ).datepicker(); 489 } 490 491 //slider range 492 $(".slider-range" ).each(function(index) { 493 var counter = $(this).data('counter'); 494 var position = $(this).data('position'); 495 var from = parseInt($(this).data('from'),10); 496 var to = parseInt($(this).data('to'),10); 497 var min = parseInt($(this).data('min'),10); 498 var max = parseInt($(this).data('max'),10); 499 $(this).find(".range").attr("id","slider-range-"+index); 500 $(this).find(".amount-start").attr("id","amount-start-"+index); 501 $(this).find(".amount-end").attr("id","amount-end-"+index); 502 $("#slider-range-"+index).slider({ 503 range: true, 504 min: min, 505 max: max, 506 values: [ from , to ], 507 slide: function( event, ui ) { 508 if (position=="start"){ 509 $("#amount-start-"+index).val(counter + ui.values[ 0 ]); 510 $("#amount-end-"+index).val(counter + ui.values[ 1 ]); 511 } else{ 512 $("#amount-start-"+index).val(ui.values[ 0 ] + counter); 513 $("#amount-end-"+index).val(ui.values[ 1 ] + counter); 514 } 515 } 516 }); 517 if (position=="start"){ 518 $("#amount-start-"+index).val(counter + $("#slider-range-"+index).slider("values",0)); 519 $("#amount-end-"+index).val(counter + $("#slider-range-"+index).slider("values",1)); 520 } else { 521 $("#amount-start-"+index).val($("#slider-range-"+index).slider("values",0) + counter); 522 $("#amount-end-"+index).val($("#slider-range-"+index).slider("values",1) + counter); 523 } 524 }); 525 526 527 //circliful 528 if ($('.circle-wrapper').length){ 529 $('.circle-wrapper').viewportChecker({ 530 classToAdd: 'counted', 531 offset: 100, 532 callbackFunction: function(elem, action){ 533 elem.find('.circle').circliful(); 534 } 535 }); 536 } 537 538 //progress bar 539 if ($('.progress-wrapper').length){ 540 $('.progress-wrapper').viewportChecker({ 541 classToAdd: 'counted', 542 offset: 100, 543 callbackFunction: function(elem, action){ 544 elem.find('.count').countTo(); 545 546 elem.find('.progress-block').not('.counted').each(function(){ 547 $(this).addClass('counted'); 548 var $progress_bar = $(this).find('.progress-bar'); 549 var speed = parseInt($progress_bar.attr("data-speed"),10); 550 var to = $progress_bar.attr("data-to"); 551 $progress_bar.animate({width: to+"%"}, {duration: speed}); 552 }); 553 } 554 }); 555 } 556 557 558 //isotope filter 559 $container = $('.filter-content'); 560 $('.filter-nav').on( 'click', 'a', function() { 561 var filterValue = $(this).attr('data-filter'); 562 $container.isotope({ filter: filterValue }); 563 var $buttonGroup = $(this).parent().parent(); 564 $buttonGroup.find('.selected').removeClass('selected'); 565 $(this).parent().addClass('selected'); 566 }); 567 568 //timer 569 function format(number){ 570 if(number===0){ 571 return '00'; 572 }else if (number < 10) { 573 return '0' + number; 574 } else{ 575 return ''+number; 576 } 577 } 578 function setTimer(final_date){ 579 var today = new Date(); 580 var finalTime = new Date(final_date); 581 var interval = finalTime - today; 582 if(interval<0) interval = 0; 583 var days = parseInt(interval/(1000*60*60*24),10); 584 var daysLeft = interval%(1000*60*60*24); 585 var hours = parseInt(daysLeft/(1000*60*60),10); 586 var hoursLeft = daysLeft%(1000*60*60); 587 var minutes = parseInt(hoursLeft/(1000*60),10); 588 var minutesLeft = hoursLeft%(1000*60); 589 var seconds = parseInt(minutesLeft/(1000),10); 590 $('.days').text(format(days)); 591 $('.hours').text(format(hours)); 592 $('.minutes').text(format(minutes)); 593 $('.seconds').text(format(seconds)); 594 } 595 if($('.back-counter').length){ 596 var final_date = $('.back-counter').data('finaldate'); 597 setTimer(final_date); 598 setInterval(function(){setTimer(final_date);}, 1000); 599 } 600 601 //countdown 602 if($('.ClassyCountdown').length){ 603 $('#countdown').ClassyCountdown({ 604 theme: "white", // theme 605 end: $.now() + 645600, 606 // custom style for the countdown 607 style: { 608 element: '', 609 labels: false, 610 days: {gauge: {thickness: 0.05}}, 611 hours: {gauge: {thickness: 0.05}}, 612 minutes: {gauge: {thickness: 0.05}}, 613 seconds: {gauge: {thickness: 0.05}} 614 } 615 }); 616 } 617 618 619 /*==============================*/ 620 /* 06 - CHANGE CONTENT */ 621 /*==============================*/ 622 //change hotel content simulate 623 $('.choose-hotel .drop span a').on( "click", function() { 624 var $hotelCont = $(this).parents(".main-wraper"); 625 var $hotelBg = $hotelCont.find('.hotel-clip .bg'); 626 var bgImg = $hotelBg.css('background-image'); 627 if(bgImg.match("hotel_bg.jpg")) { 628 629 $hotelBg.fadeTo(800, 0, function() 630 { 631 $(this).css({'background-image': bgImg.replace('hotel_bg.jpg','hotel_bg2.jpg')}); 632 }).fadeTo(800, 1); 633 //$hotelBg.stop().css('background-image', bgImg.replace('hotel_bg.jpg','hotel_bg2.jpg')); 634 635 $hotelCont.find('.hotel-choose:not(.hotel-hidden)').hide(0); 636 $hotelCont.find('.hotel-choose.hotel-hidden').show(0, function() {resizeCall();}); 637 } else{ 638 639 $hotelBg.fadeTo(800, 0, function() 640 { 641 $(this).css({'background-image': bgImg.replace('hotel_bg2.jpg','hotel_bg.jpg')}); 642 }).fadeTo(800, 1); 643 //$hotelBg.stop().css('background-image', bgImg.replace('hotel_bg2.jpg','hotel_bg.jpg')); 644 $hotelCont.find('.hotel-choose.hotel-hidden').hide(0); 645 $hotelCont.find('.hotel-choose:not(.hotel-hidden)').show(0, function() {resizeCall();}); 646 647 } 648 }); 649 650 //change slider 651 $('.change-slider').on( "click", function() { 652 var img = $(this).attr("href"); 653 $(this).parents('.section').find('.bg-bg-chrome').fadeTo('slow', 0.3, function() 654 { 655 $(this).css({'background-image':'url('+img+')'}); 656 }).fadeTo('slow', 1); 657 $(this).parents('.section').find('.change-slider.active').removeClass('active'); 658 $(this).addClass('active'); 659 return false;
660 }); 661 662 //left slider change 663 $(document).on('click', '.slide-preview a', function(){ 664 var img = $(this).attr("href"); 665 $(this).parents('.slider-block-right').siblings('.slider-block-left').fadeTo('slow', 0.3, function() 666 { 667 $(this).css({'background-image':'url('+img+')'}); 668 }).fadeTo('slow', 1); 669 $(this).siblings('.active').removeClass('active'); 670 $(this).addClass('active'); 671 return false; 672 }); 673 674 //tab-tour-block 675 var tourFinish = 0; 676 $('.tab-tour-header .tab-tour').on( "click", function() { 677 var $t = $(this); 678 if(tourFinish || $t.hasClass('active')) return false; 679 680 tourFinish = 1; 681 var index = $t.index(); 682 var $c_content = $t.parents('.tab-tour-header').siblings('.tab-tour-content'); 683 684 $t.siblings('.active').removeClass('active'); 685 $t.addClass('active'); 686 687 $c_content.find('.hotel-wrpp.active').fadeOut(800, function(){ 688 $(this).removeClass('active'); 689 $c_content.find('.hotel-wrpp').eq(index).fadeIn(800, function() {$(this).addClass('active');tourFinish = 0;resizeCall();}); 690 }); 691 }); 692 $('.tab-select .drop span a').on( "click", function() { 693 var $t = $(this); 694 var index = $t.index(); 695 var $c_content = $t.parents('.tab-select').siblings('.tab-tour-content'); 696 $c_content.find('.hotel-wrpp.active').fadeOut(800, function(){ 697 $(this).removeClass('active'); 698 $c_content.find('.hotel-wrpp').eq(index).fadeIn(800, function() {$(this).addClass('active');tourFinish = 0;resizeCall();}); 699 }); 700 }); 701 702 //list-grid change 703 $('.change-list').on( "click", function() { 704 if ($(this).hasClass('active')) return false; 705 $(this).siblings('.active').removeClass('active'); 706 $(this).addClass('active').parents('.list-header').siblings('.grid-content').removeClass('grid-content').addClass('list-content'); 707 }); 708 $('.change-grid').on( "click", function() { 709 if ($(this).hasClass('active')) return false; 710 $(this).siblings('.active').removeClass('active'); 711 $(this).addClass('active').parents('.list-header').siblings('.list-content').removeClass('list-content').addClass('grid-content'); 712 }); 713 714 /*==============================*/ 715 /* 06 - FULL PAGE */ 716 /*==============================*/ 717 function initFullPage(){ 718 if($('.fullpage').length){ 719 if (winW<992) return false; 720 $('body').css("overflow-y", "hidden"); 721 $('.fullpage').css("height", winH+"px"); 722 $('html, body').scrollTop(0); 723 } 724 } 725 function updateFullPage(){ 726 if(!$('.fullpage').length) return false; 727 if (winW>=992){ 728 var $wrapper = $('.fullpage-wrapper'); 729 var $pageActive = $('.fullpage .section.active'); 730 var index = $pageActive.index(); 731 var footer_hieght = $('.footer').outerHeight(); 732 if ($pageActive.hasClass('footer')){ 733 $wrapper.css('top', '-' +(winH*(index-1)+footer_hieght)+'px'); 734 } else { 735 $wrapper.css('top', '-' +winH*(index)+'px'); 736 } 737 738 $('html, body').scrollTop(0); 739 //alert(count+'/'+index+'/'+winH); 740 } else{ 741 $('body').css("overflow-y", "auto"); 742 } 743 744 } 745 746 if ($('.fullpage').length){ 747 var fullpage = 1; 748 $('.fullpage').mousewheel(function(event) { 749 if (fullpage === 0) return false; 750 if(winW<=991) return false; 751 fullpage = 0; 752 753 var $wrapper = $('.fullpage-wrapper'); 754 var $pageActive = $('.fullpage .section.active'); 755 var index = $pageActive.index(); 756 var footer_hieght = $('.footer').outerHeight(); 757 758 if(event.deltaY==-1){ 759 if(!$pageActive.hasClass('footer')){ 760 if ($pageActive.next().hasClass('footer')){ 761 $pageActive.removeClass('active').next().addClass('active'); 762 var count = (winH*(index))+footer_hieght; 763 //$wrapper.css('top', '-' +count+'px'); 764 $wrapper.animate({top:'-'+count+'px'}, "slow", function(){fullpage=1;}); 765 } else{ 766 $pageActive.removeClass('active').next().addClass('active'); 767 $wrapper.animate({top:'-'+winH*(index+1) +'px'}, "slow", function(){fullpage=1;}); 768 //$wrapper.css('top', '-'+winH*(index+1) +'px'); 769 } 770 } else{fullpage=1;} 771 } else if(event.deltaY==1){ 772 if(index!==0){ 773 $pageActive.prev().addClass('active'); 774 $pageActive.removeClass('active'); 775 $wrapper.animate({top:'-'+winH*(index-1) +'px'}, "slow", function(){fullpage=1;}); 776 //$wrapper.css('top', '-'+winH*(index-1) +'px'); 777 } else{ 778 fullpage=1; 779 } 780 } 781 }); 782 } 783 784 $('.serach-item').on('mouseover', function(){ 785 $('.serach-item input').addClass('active'); 786 return false;
787 }); 788 789 $('.serach-item input').focus(function() { 790 $(this).addClass('active'); 791 return false; 792 }); 793 794 $('.serach-item input').blur(function() { 795 $(this).removeClass('active'); 796 return false; 797 }); 798 799 /*==============================*/ 800 /* 06 - MENU */ 801 /*==============================*/ 802 $('nav.menu .fa-angle-down, nav.menu .fa-chevron-right').on("click", function () { 803 $(this).parent('a').parent('li').toggleClass('active'); 804 $(this).parent('a').next('.dropmenu').slideToggle(); 805 return false; 806 }); 807 808 $('nav.menu > ul > li > a').on("click", function () { 809 if ($(this).parent('li').has(".dropmenu").length) { 810 $(this).parent('li').toggleClass('active'); 811 $(this).next('.dropmenu').slideToggle(); 812 return false; 813 } else { 814 return true; 815 } 816 }); 817 818 $('.nav-menu-icon a').on('click', function() { 819 if ($('nav').hasClass('slide-menu')){ 820 $('nav').removeClass('slide-menu'); 821 $(this).removeClass('active'); 822 $('body').toggleClass('menu_opened'); 823 }else { 824 $('nav').addClass('slide-menu'); 825 $(this).addClass('active'); 826 $('body').toggleClass('menu_opened'); 827 } 828 return false; 829 }); 830 831 /***********************************/ 832 /*STYLE BAR*/ 833 /**********************************/ 834 835 $('.conf-button').on('click', function(){ 836 if ($('.style-page').hasClass('slide-right')){ 837 $('.style-page').removeClass('slide-right'); 838 $('.conf-button span').removeClass('act'); 839 }else{ 840 $('.style-page').addClass('slide-right'); 841 $('.conf-button span').addClass('act'); 842 }return false; 843 }); 844 845 $('.entry').on('click', function(){ 846 var prevTheme = $('body').attr('data-color'); 847 var newTheme = $(this).attr('data-color'); 848 if($(this).hasClass('active')) return false; 849 $(this).parent().find('.active').removeClass('active'); 850 $(this).addClass('active'); 851 $('body').attr('data-color', newTheme); 852 $('img').each(function() { 853 $(this).attr("src", $(this).attr("src").replace(prevTheme+'/', newTheme+'/')); 854 }); 855 856 localStorage.setItem("color", newTheme); 857 }); 858 859 var localStorageThemeVar = localStorage.getItem('color'); 860 $('.entry[data-color="'+localStorageThemeVar+'"]').on('click'); 861 862 863 $('.rounded').on('click', function() { 864 if($('body').hasClass('noborder')) { 865 $('body').removeClass('noborder'); 866 $(this).closest('.color-block').find('.check-option').removeClass('active'); 867 $(this).parent().addClass('active'); 868 } 869 }); 870 $('.norounded').on('click', function() { 871 $('body').addClass('noborder'); 872 $(this).closest('.color-block').find('.check-option').removeClass('active'); 873 $(this).parent().addClass('active'); 874 }); 875 876 $('.boxed').on('click', function() { 877 if($('.container').hasClass('box')) { 878 $('.container').removeClass('box'); 879 $(this).closest('.color-block').find('.check-option').removeClass('active'); 880 $(this).parent().addClass('active'); 881 initSwiper(); 882 } 883 }); 884 $('.noboxed').on('click', function() { 885 $('.container').addClass('box'); 886 $(this).closest('.color-block').find('.check-option').removeClass('active'); 887 $(this).parent().addClass('active'); 888 initSwiper(); 889 }); 890 891 892 $('.accordeon-entry h5').on('click', function(){ 893 $(this).parent().toggleClass('active'); 894 $(this).next().toggleClass('active'); 895 }); 896 897 $('.alert .fa').on('click', function(){ 898 $(this).parent().addClass('act'); 899 }); 900 901 /***********************************/ 902 /*POPUP*/ 903 /**********************************/ 904 905 if ($('.popup-gallery').length) { 906 $('.popup-gallery').magnificPopup({ 907 delegate: 'a', 908 type: 'image', 909 removalDelay: 300, 910 tLoading: 'Loading image #%curr%...', 911 mainClass: 'mfp-fade', 912 gallery: { 913 enabled: true, 914 navigateByImgClick: true, 915 preload: [0,1] 916 }, 917 zoom: { 918 enabled: true, 919 duration: 300, 920 easing: 'ease-in-out', 921 opener: function(openerElement) { 922 return openerElement.is('img') ? openerElement : openerElement.find('img'); 923 } 924 } 925 }); 926 } 927 928 /***********************************/ 929 /*TP ENTRY*/ 930 /**********************************/ 931 function tpEntryHover() { 932 $('.top-preview .tp_entry').on('click', function() { 933 if ($(window).width() <= 1024) { 934 $('.tp_entry').removeClass('tp_entry-active'); 935 $(this).addClass('tp_entry-active'); 936 } else { 937 $('.tp_entry').removeClass('tp_entry-active'); 938 } 939 }); 940 }; 941 942});
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.