File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/theluvhillhotelandcafe.com/js/functions.js
Back
/*------------------------------------ Theme Name: Maxhotel Start Date : Sep 19 2016 End Date : Last change: Version: 1.0 Assigned to: Primary use: ---------------------------------------*/ /* - Google Map * Document Scroll * Document Ready - Booking Section - Google Map - Scrolling Navigation - Add Easing Effect - Responsive Caret - Search - Rev Slider - Counter Section - Client Carousel - Testimonials Section - Gallery Section - Gallery Single - Video Section - Offer Section - Whychooseus Section - Date Time Picker - Contact Map - Quick Contact Form * Window Load - Site Loader */ (function($) { "use strict" /* - Booking Section */ function booking_img() { var width = $(window).width(); var booking_section_height = $(".booking-section").height(); var booking_content_height = $(".booking-detail").height(); if ( width >= 992 ) { $( ".booking-img" ).removeAttr("style"); $( ".booking-img img" ).remove(); var booking_img = $(".booking-img").attr("data-image"); $( ".booking-img" ).css({"background-image":"url('" + booking_img + "')","height": booking_section_height }); } else { $( ".booking-img" ).removeAttr("style"); $( ".booking-img img" ).remove(); var booking_img = $(".booking-img").attr("data-image"); $( ".booking-img" ).append("<img src='"+ booking_img +"' />") } } /* - Google Map */ function initialize(obj) { var lat = $("#"+obj).attr("data-lat"); var lng = $("#"+obj).attr("data-lng"); var contentString = $("#"+obj).attr("data-string"); var myLatlng = new google.maps.LatLng(lat,lng); var map, marker, infowindow; var image = "images/marker.png"; var zoomLevel = parseInt($("#"+obj).attr("data-zoom") ,10); var styles = [{"featureType":"landscape","stylers":[{"saturation":" "},{"lightness":" "},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":" "},{"lightness":" "},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":" "},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":" "},{"lightness":" "},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":" "},{"lightness":" "},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":" "},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":" "},{"saturation":" "}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":" "},{"saturation":" "}]}] var styledMap = new google.maps.StyledMapType(styles,{name: "Styled Map"}); var mapOptions = { zoom: zoomLevel, disableDefaultUI: true, center: myLatlng, scrollwheel: false, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, "map_style"] } } map = new google.maps.Map(document.getElementById(obj), mapOptions); map.mapTypes.set("map_style", styledMap); map.setMapTypeId("map_style"); infowindow = new google.maps.InfoWindow({ content: contentString }); marker = new google.maps.Marker({ position: myLatlng, map: map, icon: image }); google.maps.event.addListener(marker, "click", function() { infowindow.open(map,marker); }); } /* ## Document Ready - Handler for .ready() called */ $(document).ready(function($) { /* - Scrolling Navigation */ var scroll = $(window).scrollTop(); var width = $(window).width(); var height = $(window).height(); /* - Set Sticky Menu */ if( $(".header-section").length ) { var menu_scroll = $(".header-section").offset().top; var sticky_menu = function() { var scroll_top = $(window).scrollTop(); if ( scroll_top > menu_scroll ) { $(".header-section").addClass("navbar-fixed-top animated fadeInDown"); } else { $(".header-section").removeClass("navbar-fixed-top animated fadeInDown"); } }; sticky_menu(); } /* Event - Window Scroll */ $(window).scroll(function() { /* - Set Sticky Menu */ if( $(".header-section").length ) { sticky_menu(); } }); $('.navbar-nav li a[href*="#"]:not([href="#"]), .site-logo a[href*="#"]:not([href="#"])').on("click", function(e) { var $anchor = $(this); $("html, body").stop().animate({ scrollTop: $($anchor.attr("href")).offset().top - 49 }, 1500, "easeInOutExpo"); e.preventDefault(); }); /* - Responsive Caret */ $(".ddl-switch").on("click", function() { var li = $(this).parent(); if ( li.hasClass("ddl-active") || li.find(".ddl-active").length !== 0 || li.find(".dropdown-menu").is(":visible") ) { li.removeClass("ddl-active"); li.children().find(".ddl-active").removeClass("ddl-active"); li.children(".dropdown-menu").slideUp(); } else { li.addClass("ddl-active"); li.children(".dropdown-menu").slideDown(); } }); /* - Search */ if($(".search-box").length){ $("#search").on("click", function(){ $(".search-box").addClass("active") }); $(".search-box span").on("click", function(){ $(".search-box").removeClass("active") }); } /* - Rev Slider */ if($(".slider-section").length){ $("#home-slider1").revolution({ sliderType:"standard", sliderLayout:"auto", delay:6000, navigation: { arrows:{ enable:true, style:"uranus" }, bullets: { enable:true, hide_onmobile:true, hide_under:768, style:"zeus", hide_onleave:false, direction:"horizontal", h_align:"center", v_align:"bottom", h_offset:0, v_offset:40, space:10, tmp:'' } }, responsiveLevels:[1920,1024,768,480], gridwidth:[1920,1024,768,480], gridheight:[903,675,580,480], }); $("#home-slider2").revolution({ sliderType:"standard", sliderLayout:"auto", delay:6000, navigation: { arrows:{ enable:true, style:"uranus" }, }, responsiveLevels:[1920,1024,768,480], gridwidth:[1920,1024,768,480], gridheight:[901,675,580,480], }); } /* - Counter Section */ if($(".counter-section").length) { $(".counter-section").each(function () { var $this = $(this); var myVal = $(this).data("value"); $this.appear(function() { var statistics_item_count = 0; var statistics_count = 0; statistics_item_count = $( "[id*='statistics_count-']" ).length; for(var i=1; i<=statistics_item_count; i++) { statistics_count = $( "[id*='statistics_count-"+i+"']" ).attr( "data-statistics_percent" ); $("[id*='statistics_count-"+i+"']").animateNumber({ number: statistics_count }, 4000); } }); }); } /* - Client Carousel */ if( $(".clients-carousel").length ) { $(".clients-carousel").owlCarousel({ loop: true, margin: 0, nav: true, dots: false, autoplay: false, responsive:{ 0:{ items: 1 }, 500:{ items: 2 }, 600:{ items: 3 }, 1000:{ items: 4 } } }); } /* - Testimonials Section */ if($(".testimonial-carousel-1").length){ $(".testimonial-carousel-1").owlCarousel({ loop: true, margin: 10, dots: false, nav:false, autoplay:true, autoplayHoverPause:true, responsive:{ 0:{ items:1 }, 640:{ items:2 }, 992:{ items:2 }, 1200:{ items:2 } } }) } if($(".testimonial-carousel-2").length){ $(".testimonial-carousel-2").owlCarousel({ loop: true, margin: 10, dots: false, nav:true, autoplay:true, autoplayHoverPause:true, responsive:{ 0:{ items:1 }, 640:{ items:2 }, 992:{ items:2 }, 1200:{ items:2 } } }) } /* - Gallery Section */ setTimeout(function() { var $container = $(".portfolio-list"); $container.isotope({ itemSelector: ".portfolio-list > li", gutter: 0, transitionDuration: "0.5s" }); $("#filters a").on("click",function(){ $("#filters a").removeClass("active"); $(this).addClass("active"); var selector = $(this).attr("data-filter"); $container.isotope({ filter: selector }); return false; }); }, 4000); if( $(".content-image-block").length ){ $(".content-block-hover").magnificPopup({ delegate: "a.zoom", type: "image", tLoading: "Loading image #%curr%...", mainClass: "mfp-img-mobile", gallery: { enabled: true, navigateByImgClick: false, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', } }); } /* - Gallery Single */ if( $(".gallery-details-thumb").length ){ $(".gallery-details-thumb").flexslider({ animation: "slide", controlNav: false, animationLoop: false, slideshow: false, itemWidth: 373, itemMargin: 30, asNavFor: ".gallery-details-full" }); $(".gallery-details-full").flexslider({ animation: "slide", controlNav: false, animationLoop: false, slideshow: false, sync: ".gallery-details-thumb" }); } /* - Offer Section */ if( $(".offer-box").length ){ $(".offer-content").magnificPopup({ delegate: "a.zoom", type: "image", tLoading: "Loading image #%curr%...", mainClass: "mfp-img-mobile", gallery: { enabled: true, navigateByImgClick: false, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', } }); } if($(".offer-carousel").length){ $(".offer-carousel").owlCarousel({ loop: true, margin: 10, dots: false, nav:true, autoplay:true, autoplayHoverPause:true, responsive:{ 0:{ items:1 }, 640:{ items:2 }, 992:{ items:2 }, 1200:{ items:2 } } }) } /* - Video Section */ $(".video-section a").magnificPopup({ disableOn: 700, type: "iframe", mainClass: "mfp-fade", removalDelay: 160, preloader: false, fixedContentPos: false }); /* - Whychooseus Section */ if( $(".choose-us-block").length ){ $(".choose-us-cover").magnificPopup({ delegate: "a.zoom", type: "image", tLoading: "Loading image #%curr%...", mainClass: "mfp-img-mobile", gallery: { enabled: true, navigateByImgClick: false, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', } }); } /* - Booking Section */ booking_img(); /* - Date Time Picker */ $("#datepicker1,#datepicker2,#datepicker3,#datepicker4").datetimepicker({ pickTime: false }); /* - Contact Map */ if($("#map-canvas-contact").length==1){ initialize("map-canvas-contact"); } if($("#map-canvas-contact-2").length==1){ initialize("map-canvas-contact-2"); } /* - Quick Contact Form */ $( "#btn_submit" ).on( "click", function(event) { event.preventDefault(); var mydata = $("form").serialize(); $.ajax({ type: "POST", dataType: "json", url: "contact.php", data: mydata, success: function(data) { if( data["type"] == "error" ){ $("#alert-msg").html(data["msg"]); $("#alert-msg").removeClass("alert-msg-success"); $("#alert-msg").addClass("alert-msg-failure"); $("#alert-msg").show(); } else { $("#alert-msg").html(data["msg"]); $("#alert-msg").addClass("alert-msg-success"); $("#alert-msg").removeClass("alert-msg-failure"); $("#input_name").val(""); $("#input_email").val(""); $("#input_phone").val(""); $("#textarea_message").val(""); $("#alert-msg").show(); } }, error: function(xhr, textStatus, errorThrown) { alert(textStatus); } }); }); }); /* - Document Ready /- */ /* ## Window Resize */ $( window ).resize(function() { var width = $(window).width(); var height = $(window).height(); /* - Booking Section */ booking_img(); }); /* ## Window Load - Handler for .load() called */ $(window).load(function() { /* - Site Loader */ if ( !$("html").is(".ie6, .ie7, .ie8") ) { $("#site-loader").delay(1000).fadeOut("slow"); } else { $("#site-loader").css("display","none"); } }); })(jQuery);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings