/* Template Name: AdventureGene Description: This is a - Travel Adventure & Tours HTML5 Template; Version: 1.0 Authot: Website: ersion: 1.0 NOTE: This is js file contents all jQuery plugins. */ /*================================================ [ Table of contents ] ================================================*/ (function($) { "use strict"; jQuery(document).ready(function($) { $('#loader-wrapper').hide(); if ($('#welcome-slide').length) { $('#welcome-slide').owlCarousel({ loop: true, margin: 0, nav: true, autoplay: true, autoplayTimeout: 8000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 1 } } }) } // === 1. Hero Slider === $(window).scroll(function(){ if ($(this).scrollTop() > 600) { $('#list-example').addClass('showscroll-spy'); } else { $('#list-example').removeClass('showscroll-spy'); } }); /* ==== 02. jQuery MeanMenu Active ==== */ if ($('.gene-nav').length) { jQuery('.gene-nav').meanmenu(); } /* ==== 03. CounterUp Active ==== */ if ($('.counter').length) { $('.counter').counterUp({ delay: 10, time: 2000 }); } if ($('.partner-wrap').length) { $('.partner-wrap').owlCarousel({ autoplay: 5000, loop: true, autoplayHoverPause: false, smartSpeed: 500, nav: false, navText: ['', ''], dots: false, items: 6, margin: 30, responsiveClass: true, responsive: { 0: { items: 2, }, 600: { items: 2, }, 768: { items: 2, }, 991: { items: 4, }, 1200: { items: 6, } } }) } // Similar Tips // if ($('.adv-similar-detail-wrap').length) { // $('.adv-similar-detail-wrap').owlCarousel({ // autoplay: 5000, // loop: true, // autoplayHoverPause: false, // smartSpeed: 500, // nav: false, // navText: ['', ''], // dots: false, // items: 6, // margin: 30, // responsiveClass: true, // responsive: { // 0: { // items: 1, // }, // 600: { // items: 1, // }, // 768: { // items: 2, // }, // 991: { // items: 3, // }, // 1200: { // items: 3, // } // } // }) // } if ($('.featuredpackage-sl').length) { $('.featuredpackage-sl').owlCarousel({ autoplay: 5000, loop: true, autoplayHoverPause: false, smartSpeed: 500, nav: false, navText: ['', ''], dots: false, items: 6, margin: 30, responsiveClass: true, responsive: { 0: { items: 1, }, 600: { items: 1, }, 768: { items: 2, }, 991: { items: 3, }, 1200: { items: 3, } } }) } if ($('.bestselling-sl').length) { $('.bestselling-sl').owlCarousel({ autoplay: 5000, loop: true, autoplayHoverPause: false, smartSpeed: 500, nav: false, navText: ['', ''], dots: false, items: 6, margin: 30, responsiveClass: true, responsive: { 0: { items: 1, }, 600: { items: 1, }, 768: { items: 2, }, 991: { items: 2, }, 1200: { items: 2, } } }) } if ($('.testimonial-sl').length) { $('.testimonial-sl').owlCarousel({ autoplay: 5000, loop: true, autoplayHoverPause: false, smartSpeed: 500, nav: true, navText: ['', ''], dots: false, margin: 30, responsiveClass: true, responsive: { 0: { items: 1, }, 600: { items: 1, }, 768: { items: 1, }, 991: { items: 1, }, 1200: { items: 1, } } }) } if ($('.testimonial-sl2').length) { $('.testimonial-sl2').owlCarousel({ autoplay: 5000, loop: true, autoplayHoverPause: false, smartSpeed: 500, nav: true, navText: ['', ''], dots: false, margin: 30, responsiveClass: true, responsive: { 0: { items: 1, }, 600: { items: 1, }, 768: { items: 1, }, 991: { items: 1, }, 1200: { items: 1, } } }) } $(document).ready(function() { $('.main-menunav .navbar-nav .menu-item-has-children').hover(function() { $(this).children('ul').show(); }, function() { $(this).children('ul').hide(); }); $('.main-menunav .navbar-nav .menu-item-has-children li').hover(function() { $(this).next().show(); }, function() { // let isHovered = $(this).next('ul').is(":hover"); // if(! isHovered){ // $(this).next().hide(); // } }); }); $('.searchboxfull').click(function() { $('.form-search-overlay').addClass('showformmfull'); }); $('.login-cart ul li .close-btn').click(function() { $('.form-search-overlay').removeClass('showformmfull'); }) $('.main-menu-wrap #cssmenu > ul > li:nth-child(2)').addClass('menu-parent'); // $('#accordionExample').on('shown.bs.collapse hidden.bs.collapse', function() { // var accordionItems = $('.accordion-item'); // accordionItems.each(function() { // var collapseDiv = $(this).find('.collapse'); // var button = $(this).find('.accordion-button'); // var icon = button.find('i'); // if (collapseDiv.hasClass('show')) { // icon.removeClass('fa-plus').addClass('fa-minus'); // } else { // icon.removeClass('fa-minus').addClass('fa-plus'); // } // }); // }); // $('#swal2-content').find(!).remove(); $('.quick-icon-area .activities-wrap .col-sm-6:nth-child(6)').removeClass('col-lg-3'); $('.quick-icon-area .activities-wrap .col-sm-6:nth-child(7)').removeClass('col-lg-3'); $('.faq-area .faq-collapse .faq-expand').click(function() { $('.accordion .collapse').addClass('show'); }); $('.faq-area .faq-collapse .faq-collapse').click(function() { $('.accordion .collapse').removeClass('show'); }); $('.trip-itinery .itinerary-titlewrap .expand-itinerary .expand-btn').click(function() { $('.accordion .collapse').addClass('show'); }); $('.trip-itinery .itinerary-titlewrap .expand-itinerary .collapse-btn').click(function() { $('.accordion .collapse').removeClass('show'); }); $('.about-companyinfo .company-info .more').click(function() { $('.about-companyinfo .company-info').toggleClass('show-height'); if ($(this).text() === "Read More ") { $(this).text("Read Less "); } else { $(this).text("Read More "); } }); $('#gallery').magnificPopup({ delegate: 'a', // child items selector, by clicking on it popup will open type: 'image', gallery: { enabled: true, tCounter: "%curr% of %total%" }, }); // Check the initial width on page load if ($(window).width() < 768) { // Add the "container" class to the parent div $('.find-adventure-form').addClass('container'); } // Attach a resize event listener to dynamically add/remove the class $(window).resize(function() { if ($(window).width() < 768) { $('.find-adventure-form').addClass('container'); } else { $('.find-adventure-form').removeClass('container'); } }); /* ==== 08. Cart Plus Minus ==== */ var CartPlusMinus = $('.cart-plus-minus'); CartPlusMinus.prepend('
-
'); CartPlusMinus.append('
+
'); $(".qtybutton").on("click", function() { var $button = $(this); var oldValue = $button.parent().find("input").val(); if ($button.text() === "+") { var newVal = parseFloat(oldValue) + 1; } else { // Don't allow decrementing below zero if (oldValue > 0) { var newVal = parseFloat(oldValue) - 1; } else { newVal = 1; } } $button.parent().find("input").val(newVal); }); /* ==== 06. Range Slider ==== */ if ($('.slider-product-sorting').length) { $(function() { $(".slider-product-sorting").slider({ range: true, min: 0, max: 1000, values: [200, 600], slide: function(event, ui) { $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); } }); $("#amount").val("$" + $(".slider-product-sorting").slider("values", 0) + " - $" + $(".slider-product-sorting").slider("values", 1)); }); } // ========== isotope $('.isotope_wrap').imagesLoaded(function() { var $grid = $('.isotope_wrap').isotope({ itemSelector: '.isotope_item', percentPosition: true, masonry: { columnWidth: '.isotope_item', } }); }); /* ==== 05. ScrollUp ==== */ // $.scrollUp({ // scrollText: '', // easingType: 'linear', // scrollSpeed: 900, // animation: 'fade' // }); }); var current_page_URL = location.href; $(".gene-nav ul li a").each(function() { if ($(this).attr("href") !== "#") { var target_URL = $(this).prop("href"); if (target_URL == current_page_URL) { $('.gene-nav a').parents('li, ul').removeClass('active'); $(this).parent('li').addClass('active'); return false; } } }); // ==== 11. Sticky Header ==== // $(function() { // var header = $("#header"), // yOffset = 0, // triggerPoint = 200; // $(window).on('scroll', function() { // yOffset = $(window).scrollTop(); // if (yOffset >= triggerPoint) { // header.removeClass("animated cssanimation"); // header.addClass("navbar-fixed-top sticky cssanimation animated fadeInTop"); // } else { // header.removeClass("navbar-fixed-top sticky cssanimation animated fadeInTop"); // header.addClass("animated cssanimation"); // } // }); // }); $(document).ready(function() { $('.box-icon-modern-count').each(function () { $(this).prop('Counter',0).animate({ Counter: $(this).text() }, { duration: 4000, easing: 'swing', step: function (now) { $(this).text(Math.ceil(now)); } }); }); /* ======================================== Global Slider Init ======================================== */ var globalSlickInit = $('.global-slick-init'); if (globalSlickInit.length > 0) { //todo have to check slider item $.each(globalSlickInit, function(index, value) { if ($(this).children('div').length > 1) { //todo configure slider settings object var sliderSettings = {}; var allData = $(this).data(); var infinite = typeof allData.infinite == 'undefined' ? false : allData.infinite; var arrows = typeof allData.arrows == 'undefined' ? false : allData.arrows; var autoplay = typeof allData.autoplay == 'undefined' ? false : allData.autoplay; var focusOnSelect = typeof allData.focusonselect == 'undefined' ? false : allData.focusonselect; var swipeToSlide = typeof allData.swipetoslide == 'undefined' ? false : allData.swipetoslide; var slidesToShow = typeof allData.slidestoshow == 'undefined' ? 1 : allData.slidestoshow; var slidesToScroll = typeof allData.slidestoscroll == 'undefined' ? 1 : allData.slidestoscroll; var speed = typeof allData.speed == 'undefined' ? '500' : allData.speed; var dots = typeof allData.dots == 'undefined' ? false : allData.dots; var cssEase = typeof allData.cssease == 'undefined' ? 'linear' : allData.cssease; var prevArrow = typeof allData.prevarrow == 'undefined' ? '' : allData.prevarrow; var nextArrow = typeof allData.nextarrow == 'undefined' ? '' : allData.nextarrow; var centerMode = typeof allData.centermode == 'undefined' ? false : allData.centermode; var centerPadding = typeof allData.centerpadding == 'undefined' ? false : allData.centerpadding; var rows = typeof allData.rows == 'undefined' ? 1 : parseInt(allData.rows); var autoplay = typeof allData.autoplay == 'undefined' ? false : allData.autoplay; var autoplaySpeed = typeof allData.autoplayspeed == 'undefined' ? 2000 : parseInt(allData.autoplayspeed); var lazyLoad = typeof allData.lazyload == 'undefined' ? false : allData.lazyload; // have to remove it from settings object if it undefined var appendDots = typeof allData.appenddots == 'undefined' ? false : allData.appenddots; var appendArrows = typeof allData.appendarrows == 'undefined' ? false : allData.appendarrows; var asNavFor = typeof allData.asnavfor == 'undefined' ? false : allData.asnavfor; var verticalSwiping = typeof allData.verticalswiping == 'undefined' ? false : allData.verticalswiping; var vertical = typeof allData.vertical == 'undefined' ? false : allData.vertical; var fade = typeof allData.fade == 'undefined' ? false : allData.fade; var rtl = typeof allData.rtl == 'undefined' ? false : allData.rtl; var responsive = typeof $(this).data('responsive') == 'undefined' ? false : $(this).data('responsive'); //slider settings object setup sliderSettings.infinite = infinite; sliderSettings.arrows = arrows; sliderSettings.autoplay = autoplay; sliderSettings.focusOnSelect = focusOnSelect; sliderSettings.swipeToSlide = swipeToSlide; sliderSettings.slidesToShow = slidesToShow; sliderSettings.slidesToScroll = slidesToScroll; sliderSettings.speed = speed; sliderSettings.dots = dots; sliderSettings.cssEase = cssEase; sliderSettings.prevArrow = prevArrow; sliderSettings.nextArrow = nextArrow; sliderSettings.rows = rows; sliderSettings.autoplaySpeed = autoplaySpeed; sliderSettings.autoplay = autoplay; sliderSettings.verticalSwiping = verticalSwiping; sliderSettings.vertical = vertical; sliderSettings.rtl = rtl; if (centerMode != false) { sliderSettings.centerMode = centerMode; } if (centerPadding != false) { sliderSettings.centerPadding = centerPadding; } if (lazyLoad != false) { sliderSettings.lazyLoad = lazyLoad; } if (appendDots != false) { sliderSettings.appendDots = appendDots; } if (appendArrows != false) { sliderSettings.appendArrows = appendArrows; } if (asNavFor != false) { sliderSettings.asNavFor = asNavFor; } if (fade != false) { sliderSettings.fade = fade; } if (responsive != false) { sliderSettings.responsive = responsive; } $(this).slick(sliderSettings); } }); } $('.header .button-navigation-bar #search').click(function(e){ e.preventDefault(); console.log('clicked!'); $('.header .keysearch_module').css({"visibility": "visible", "opacity": "1"}); }); $('.header .keysearch_module .discard').click(function(){ $('.header .keysearch_module').css({"visibility": "hidden", "opacity": "0"}); }); // For luxury mobile navigation $('.luxury .header .mobile-navigation .menu-item-has-children').click(function(e){ e.preventDefault(); e.stopPropagation(); $(this).find('.sub-menu').toggleClass('showfullmenu'); $(this).toggleClass('minimize'); $(this).find('.sub-menu').removeClass('display'); if($(this).find('.menu-item-has-children')){ $(this).find('.menu-item-has-children').children('ul').toggleClass('showfullmenu'); $(this).find('.menu-item-has-children').children('ul').removeClass('display'); } }); $('.luxury .header .mobile-navigation .menu-item-has-children .sub-menu').click(function(e){ e.stopPropagation(); }); $('.header .mobile-navigation .menu-item-has-mega-menu .nav-link').click(function(e){ e.stopPropagation(); let tar = ".header .mobile-navigation .menu-item-has-mega-menu .mega-menu-container-right "+$(this).attr('data-bs-target'); $(this).toggleClass('minimize'); if($(tar).hasClass('show')){ $(tar).toggleClass('display'); }else{ $(tar).toggleClass('show display'); } }); $('.header .mobile-navigation .menu-item-has-mega-menu').click(function(e){ e.preventDefault(); $(this).toggleClass('minimize'); $(this).find('.nav-link').toggleClass('display'); }); $('.header .mobile-navigation .menu-item-has-mega-menu .packages-menu-content li').click(function(e){ e.stopPropagation(); }); $('.header .navbar #menu-open').click(function(){ $('.header .mobile-navigation').show(); $('.header .navbar #menu-open').hide(); $('.header .navbar #menu-close').show() }); $('.header .navbar #menu-close').click(function(){ $('.header .mobile-navigation').hide(); $('.header .navbar #menu-close').hide() $('.header .navbar #menu-open').show(); }); $('.header #notification-btn-close').click(function(){ $('.header .Notification_notification').hide(); }); /*----------------------------------- Scrolling Full width section -----------------------------------*/ $(".subscribeArea .container").length && $(window).on("scroll", function() { ! function(t, a = 0) { var i = $(window).scrollTop(), o = i + $(window).height(), s = $(t).offset().top; return s + $(t).height() - parseInt(a) <= o && s >= i }(".subscribeArea .container", 200) ? $(".subscribeArea .container").removeClass("container-fluid"): $(".subscribeArea .container").addClass("container-fluid") }) // window.onscroll = function() {myFunction()}; // var navbar = document.getElementById("navbar"); // var sticky = navbar.offsetTop; // function myFunction() { // if (window.pageYOffset >= sticky) { // navbar.classList.add("sticky-top") // } else { // navbar.classList.remove("sticky-top"); // } // } // If Image not found $('.img-not-found').each(function(e){ var rand_images = ["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg"]; var rand_path = "https://nepalione.com/assets/img/random_images/"; var rand_url = rand_path + rand_images[Math.floor(Math.random() * rand_images.length)]; // console.log(rand_url); $(this).attr("src", rand_url); }); // package details $(document).ready(function() { // Function to add 'fullbg-small' class function addFullBgSmall($collapse) { const $button = $collapse.prev().find('.accordion-button'); const $boxDay = $button.find('.box-day'); $boxDay.addClass('fullbg-small'); $button.find('.fa-solid').removeClass('fa-plus').addClass('fa-minus'); } // Function to remove 'fullbg-small' class function removeFullBgSmall($collapse) { const $button = $collapse.prev().find('.accordion-button'); const $boxDay = $button.find('.box-day'); $boxDay.removeClass('fullbg-small'); $button.find('.fa-solid').removeClass('fa-minus').addClass('fa-plus'); } // Event listener for showing accordion item $('.allitinerarys .accordion-collapse').on('shown.bs.collapse', function() { addFullBgSmall($(this)); }); // Event listener for hiding accordion item $('.allitinerarys .accordion-collapse').on('hidden.bs.collapse', function() { removeFullBgSmall($(this)); }); // Initial check to add 'fullbg-small' class to the already opened accordion items $('.allitinerarys .accordion-collapse.show').each(function() { addFullBgSmall($(this)); }); }); $(document).ready(function() { $('.luxury .package-container #itinerary .title-btns button').click(function() { var button = $(this); // Toggle button text if (button.text() === 'Expand All +') { button.text('Collapse All -'); $('.accordion-collapse.collapse').addClass('show'); } else { button.text('Expand All +'); $('.accordion-collapse.collapse').removeClass('show'); } }); }); $(window).scroll(function(){ if ($(this).scrollTop() > 110) { $('.luxury .header-sm').addClass('header-fixed'); } else { $('.luxury .header-sm').removeClass('header-fixed'); } }); $('#collapse-btn').click(function(){ console.log('clicked coll'); $('.accordion-collapse').removeClass('show'); }); $('#expand-btn').click(function(){ console.log('clicked exp'); $('.accordion-collapse').addClass('show'); }); // $('.accordion-button').click(function(){ // $(this).children().toggleClass('fa-minus'); // $(this).children().toggleClass('fa-plus'); // }); $('.popup-video').magnificPopup({ type: 'iframe' }); // $('.menu-item-has-mega-menu a:nth-child(1)').click(function(e){ // e.preventDefault(); // if($(this).text().toLowerCase() == "holiday" || $(this).children().text().toLowerCase() == "holidays" ){ // let h_loc = "/holiday"; // // console.log(h_loc, "_self"); // $(location).prop("href", h_loc); // } // }); }); /* ==== 21. Preloader ==== */ // $(window).on('load',function(){ // jQuery(".preloader-wrap").fadeOut(500); // }); })(jQuery);