$('.nav').nav(); // slick news $(document).ready(function(){ $('.news').slick({ infinite: false, slidesToShow: 3, dots: true, slidesToScroll: 1, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); $('.partners-slider').slick({ infinite: false, slidesToShow: 1, dots: true, slidesToScroll: 1 }); }); // scroll top $(document).ready(function() { //Check to see if the window is top if not then display button $(window).scroll(function() { if ($(this).scrollTop() > 50) { $('.scrollToTop').fadeIn(); } else { $('.scrollToTop').fadeOut(); } }); //Click event to scroll to top $('.scrollToTop').click(function() { $('html, body').animate({ scrollTop: 0 }, 500); return false; }); }); $(function () { if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { var whatsapp_orig = $('#whatsapp_a').attr('href'); $('[name="whatsapp"]').each(function(element){ var orig_href = $(this).attr('href'); $(this).attr('href', $(this).attr('href').replace('web', 'api')); }); } }); // toggle search $('.facilityOption').on('click', function() { $('.other-features').slideToggle('fast'); }); // toggle fav $(".myfav").click(function(){ $('img',this).toggle(); }); // toggle search $(".search-toggle").click(function(){ $('.search-filter').slideToggle('fast'); }); // edit profile $('.editProfile').hide(); $("#editProfileBtn,#editMailBtn,#editNoBtn").click(function(){ $(this).parents(".Data").children(".recentData").hide(); $(this).parents(".Data").children(".editProfile").fadeIn(); }); $(".cancelInputBtn").click(function(){ $(this).parents(".Data").children(".editProfile").hide(); $( ".recentData" ).fadeIn( "fast" ); }); // change card $('#visaBtn').on({ 'click': function(){ $('#cardImg').attr('src','../img/visacard.png'); } }); $('#masterBtn').on({ 'click': function(){ $('#cardImg').attr('src','../img/mastercard.png'); } }); // card number $(function() { $('.cardinputno').on("input", function() { $('.cardno').text($(this).val()); }); }); $('.cardinputno').on('keypress change', function () { $(this).val(function (index, value) { return value.replace(/\W/gi, '').replace(/(.{4})/g, '$1 '); }); }); // footer height $( document ).ready(function loadfooterHeight() { var footerheight = $("footer").outerHeight(); $(".wrapper").css('padding-bottom', footerheight); }); $(window).on('resize', function() { var footerheight = $("footer").outerHeight(); $(".wrapper").css('padding-bottom', footerheight); });