$(".marquee-close").click(function() { $('.marquee').slideUp("1000"); }); $(document).ready(function() { $('#itemslider').carousel({ interval: false }); $('.carousel-showmanymoveone .item').each(function() { var itemToClone = $(this); for (var i = 1; i < 3; i++) { itemToClone = itemToClone.next(); if (!itemToClone.length) { itemToClone = $(this).siblings(':first'); } itemToClone.children(':first-child').clone() .addClass("cloneditem-" + (i)) .appendTo($(this)); } }); }); if ($('#back-to-top').length) { var scrollTrigger = 100, // px backToTop = function() { var scrollTop = $(window).scrollTop(); if (scrollTop > scrollTrigger) { $('#back-to-top').addClass('show'); } else { $('#back-to-top').removeClass('show'); } }; backToTop(); $(window).on('scroll', function() { backToTop(); }); $('#back-to-top').on('click', function(e) { e.preventDefault(); $('html,body').animate({ scrollTop: 0 }, 700); }); } $("#WriteReviewContainer").hide(); $(document).ready(function() { $(".WriteReviewBTN").click(function() { $('#WriteReviewContainer').slideDown("fast"); }); }); $(document).ready(function() { $("#CloseCommentReview").click(function() { $('#WriteReviewContainer').slideUp("fast"); }); }); $(".FAQ-Question .FAQ-Answer").hide(); $(".FAQ-Question h5").click(function() { $(this).next(".FAQ-Question .FAQ-Answer").slideToggle('fast'); }); function initMap() { var myLatLng = { lat: 22.319416, lng: 114.208127 }; var map = new google.maps.Map(document.getElementById('map'), { zoom: 16, center: myLatLng }); var marker = new google.maps.Marker({ position: myLatLng, map: map, title: 'Hello World!' }); } $(".changePassword").hide(); $("#changePWLink").click(function() { $(".changePassword").slideToggle("slow"); $(this).toggleClass("active"); if ($(this).text() == "Close") $(this).text("Change my password") else $(this).text("Close"); }); $('a[href^="#"]').on('click', function(event) { var target = $(this.getAttribute('href')); if (target.length) { event.preventDefault(); $('html, body').stop().animate({ scrollTop: target.offset().top }, 500); } }); $(".PromotionCode").hide(); $(".HavePromotion").click(function() { $(".PromotionCode").slideDown(); $(this).hide(); }); $(".HistoryDetails").hide(); $(".ViewDetails button").click(function() { $(this).next(".HistoryDetails").slideToggle('fast'); $(this).toggleClass("active"); if ($(this).text() == "Close") $(this).text("View Details") else $(this).text("Close"); }); $(".TechSpec").hide(); $("#SpecToggle").click(function() { $(".TechSpec").slideToggle("fast"); }); $(".Guaranteed-Details-Container").hide(); $("#GuranteedToggle").click(function() { $(".Guaranteed-Details-Container").slideToggle("fast"); }); $("#register-form").hide(); $(".RegisterNow").click(function() { $(this).hide(); $("#register-form").slideToggle("fast"); }); /* Light YouTube Embeds by @labnol */ /* Web: http://labnol.org/?p=27941 */ document.addEventListener("DOMContentLoaded", function() { var div, n, v = document.getElementsByClassName("youtube-player"); for (n = 0; n < v.length; n++) { div = document.createElement("div"); div.setAttribute("data-id", v[n].dataset.id); div.innerHTML = labnolThumb(v[n].dataset.id); div.onclick = labnolIframe; v[n].appendChild(div); } }); function labnolThumb(id) { var thumb = '', play = '
'; return thumb.replace("ID", id) + play; } function labnolIframe() { var iframe = document.createElement("iframe"); var embed = "https://www.youtube.com/embed/ID?autoplay=1"; iframe.setAttribute("src", embed.replace("ID", this.dataset.id)); iframe.setAttribute("frameborder", "0"); iframe.setAttribute("allowfullscreen", "1"); this.parentNode.replaceChild(iframe, this); } AOS.init({ easing: 'ease-in-out-sine' });