/************************************************************************ Template Name : Aztecs | Responsive Bootstrap CSS Template Author : Team Fudugo Version : 1.0.0 Created : 2020 File Description : Main css file of the template **************************************************************************/ $(function($) { "use strict"; /* Scroll Animation Active */ new WOW().init(); /* ---------------------------------------------------------------- [ Back To Up ] -----------------------------------------------------------------*/ $(function(){ var offset = 220; var duration = 300; $(window).on('scroll', function() { if ($(this).scrollTop() > offset) { if($('.fs-back-to-top')){ $('.fs-back-to-top').fadeIn(duration); } } else { if($('.fs-back-to-top')){ $('.fs-back-to-top').fadeOut(duration); } } }); $('.fs-back-to-top').on('click', function(event) { event.preventDefault(); $('html, body').animate({scrollTop: 0}, duration); return false; }); if($(window).scrollTop() > offset) { $('.fs-back-to-top').hide('slow'); } }); /* ---------------------------------------------------------------- [ Navbar scrolled transation ] -----------------------------------------------------------------*/ $(function () { $(document).on('scroll', function () { var $nav = $(".fixed-top"); $nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height()-40); }); }); $(document).ready(function(){ $(this).scrollTop(0); }); /* ---------------------------------------------------------------- [ DropDown Menu] -----------------------------------------------------------------*/ $(document).ready(function(){ $("ul.sub-menu ,ul.children").parent().addClass("dropdown"); $("ul.sub-menu ,ul.children").addClass("dropdown-menu"); $("li.dropdown a").addClass("dropdown-toggle"); $("ul.sub-menu li a ,ul.children li a").removeClass("dropdown-toggle"); $('.navbar .dropdown-toggle').append(''); $('a.dropdown-toggle').attr('data-toggle', 'dropdown'); }); }); $(document).ready(function($){ $(".pricing_plan_enquiry").click(function() { var $this = $(this); var plan_name = $this.data("name"); var plan_price = $this.data("price"); $("#pricing_enquiry_fullname").val(''); $("#pricing_enquiry_email").val(''); $("#pricing_enquiry_phonenumber").val(''); $("#pricing_enquiry_servicetype").val('0'); $("#pricing_enquiry_weburl").val(''); $("#pricing_enquiry_plan").val(''); $("#pricing_enquiry_plan_dis").val(''); $("#pricing_enquiry_msg").val(''); $("#pricing_enquiry_plan").val(plan_name); $("#pricing_enquiry_plan_dis").val(plan_name); $('#enq_err_name').html(""); $('#enq_err_email').html(""); $('#enq_err_phone').html(""); $('#enq_err_servicetype').html(""); $('#enq_err_weburl').html(""); $('#enq_err_msg').html(""); $("#main_pricing_enq_form").show(); $("#pricing_enquiry_modal .modal-header h4").html("Pricing Plan Details"); $("#pricing_enquiry_modal .modal-footer").css("display", "block"); $("#enquiry_form_response").hide() }) $("#pricing_plan_enquiry_form").on("submit", function(event) { var $this = $(this); event.preventDefault(); $('#enquiry_form_response').empty(); var data = { action: 'submit_pricing_enquiry_form', data: $(this).serialize() }; $.post(ajax_obj.ajaxurl, data, function(response) { if (response.pricing_enquiry_fullname) { $('#enq_err_name').html(response.pricing_enquiry_fullname); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_fullname").focus() } else if (response.pricing_enquiry_email) { $('#enq_err_email').html(response.pricing_enquiry_email); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_email").focus() } else if (response.pricing_enquiry_phonenumber) { $('#enq_err_phone').html(response.pricing_enquiry_phonenumber); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_phonenumber").focus() } else if (response.pricing_enquiry_servicetype) { $('#enq_err_servicetype').html(response.pricing_enquiry_servicetype); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_servicetype").focus() } else if (response.pricing_enquiry_weburl) { $('#enq_err_weburl').html(response.pricing_enquiry_weburl); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_weburl").focus() } else if (response.pricing_enquiry_msg) { $('#enq_err_msg').html(response.pricing_enquiry_msg); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_msg").focus() } if (response.is_mail_sent == 1) { $this.parents("#pricing_enquiry_modal").find(".modal-header h4").html("Congratulations!"); $this.parents("#pricing_enquiry_modal").find(".modal-footer").css("display", "none"); $this.parents("#pricing_enquiry_modal").find("#main_pricing_enq_form").hide(); $this.parents("#pricing_enquiry_modal").find("#enquiry_form_response").show(); $this.parents("#pricing_enquiry_modal").find("#enquiry_form_response").append(response.responce_msg); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_fullname").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_email").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_phonenumber").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_servicetype").val('0'); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_weburl").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_plan").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_plan_dis").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_msg").val('') } else if (response.is_mail_sent == 0) { $this.parents("#pricing_enquiry_modal").find(".modal-header h4").html("Oops! Something went wrong!"); $this.parents("#pricing_enquiry_modal").find(".modal-footer").css("display", "none"); $this.parents("#pricing_enquiry_modal").find("#main_pricing_enq_form").hide(); $this.parents("#pricing_enquiry_modal").find("#enquiry_form_response").show(); $this.parents("#pricing_enquiry_modal").find("#enquiry_form_response").append(response.responce_msg); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_fullname").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_email").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_phonenumber").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_servicetype").val('0'); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_weburl").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_plan").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_plan_dis").val(''); $this.parents("#pricing_enquiry_modal").find("#pricing_enquiry_msg").val('') } }, 'json') }) }); //TO REMOVE ERROR MSG function remove_errorMsg(input_id, err_id) { var input_val = jQuery("#" + input_id).val(); if (input_val.trim() != '') { jQuery('#' + err_id).html('') } }