jQuery(document).ready(function () { jQuery('#socialProfilesS4').css('display','none'); jQuery('#formShowS4').css('display','none'); jQuery(".range_sit4").ionRangeSlider({ type: "single", min: 0, max: 10, step: 1, grid: true, grid_snap: true, //onStart: updateInputs, //onChange: updateInputs, onFinish: updateInputs }); function updateInputs (data) { var pData = 'rating='+data.from; jQuery.ajax({ type: "POST", url: "http://www.arizonapooldrain.com/wp-content/plugins/site4review/rating_submit.php", data:pData, dataType: 'json', success: function(msg){ if (msg.d) { if(msg.rPop == 'social'){ jQuery('#socialProfilesS4').css('display','block'); jQuery('#formShowS4').css('display','none'); } if(msg.rPop == 'form'){ jQuery('#socialProfilesS4').css('display','none'); jQuery('#formShowS4').css('display','block'); } jQuery('#modalHwaBtn').trigger('click'); } else{ console.log('There is error'); } } }); } jQuery("input.sRatingData").on('click',function(){ event.preventDefault(); var sData = jQuery(this).val(); var pData = 'rating='+sData; jQuery.ajax({ type: "POST", url: "http://www.arizonapooldrain.com/wp-content/plugins/site4review/rating_submit.php", data:pData, dataType: 'json', success: function(msg){ if (msg.d) { console.log(msg.ratS); console.log(msg.rPop); if(msg.rPop == 'social'){ jQuery('#socialProfilesS4').css('display','block'); jQuery('#formShowS4').css('display','none'); } if(msg.rPop == 'form'){ jQuery('#socialProfilesS4').css('display','none'); jQuery('#formShowS4').css('display','block'); } jQuery('#modalHwaBtn').trigger('click'); } else{ console.log('There is error'); } } }); }); jQuery('#modalHwaBtn').on('click',function(){ event.preventDefault(); }); var modal=document.getElementById("MymodalHwa"),btn=document.getElementById("modalHwaBtn"),span=document.getElementsByClassName("closeHwa")[0];btn.onclick=function(){modal.style.display="block"},span.onclick=function(){modal.style.display="none"},window.onclick=function(n){n.target==modal&&(modal.style.display="none")}; })