core/skin/big-moving.yurecnt.ru/js/js.js

7 lines
3.1 KiB
JavaScript
Executable File

$(function(){$("a.ancLinks").click(function(){var elementClick=$(this).attr("href");var destination=$(elementClick).offset().top;$('html,body').animate({scrollTop:destination},3000);return false;});$("button").click(function(event){var link=$(this).data('link');var ajax=$(this).data('ajax');var txt=$(this).data('txt');if(link){document.location.href=link;}if(ajax){$.ajax({type:"POST",url:ajax,data:"txt="+txt})}})
$("#soc_btn a").click(function(event){var title=$("#soc_btn").attr('title');var ss=$(this).data('ss');var decription=$("#soc_btn").data('decription');var url=$("#soc_btn").data('url');var img=$("#soc_btn").data('img');switch(ss){case'vk.com':window.open('//vk.com/share.php?url=http://b-install-nt.ru&title='+title+'&description='+decription+'&image='+img,'_blank','scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');break;case'ok.ru':window.open('//ok.ru/dk?st.cmd=addShare&st._surl='+url+'&title='+title,'_blank','scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');break;case'facebook.com':window.open('//www.facebook.com/sharer/sharer.php?u='+url,'_blank','scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');break;case'mail.ru':window.open('//connect.mail.ru/share?url='+url+'&title='+title+'&description='+decription+'&imageurl='+img,'_blank','scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');break;case'google.com':window.open('//plus.google.com/share?url='+url,'_blank','scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');break;}return false;})
var $window=$(window),$target=$("#div_main_mnu"),$h=$target.offset().top;$window.on('scroll',function(){var scrollTop=window.pageYOffset||document.documentElement.scrollTop;if(scrollTop>$h&&$(window).width()>1024){$target.addClass("sheensay_fixed");}else{$target.removeClass("sheensay_fixed");}});$(".lazy").lazyload({placeholder:"/img/grey.gif",effect:"fadeIn",failure_limit:2,threshold:10});$("#span_select_gorod").click(function(event){$("#select_gorod").css('position','absolute');$("#select_gorod").show();})
$('#form_zakaz_avto').submit(function(event){event.preventDefault();var formData=new FormData(this);$.ajax({type:'POST',url:$(this).attr('action'),data:formData,cache:false,contentType:false,processData:false,success:function(data){alert(data);}});});$("#btn-add_zayavka").click(function(event){$('#form_zakaz_avto').submit();$("#close_zakaz_avto").click();})
$('#form_zvonok').submit(function(event){event.preventDefault();var formData=new FormData(this);$.ajax({type:'POST',url:$(this).attr('action'),data:formData,cache:false,contentType:false,processData:false,success:function(data){alert(data);}});});$("#btn-zvonok").click(function(event){$('#form_zvonok').submit();$("#close_zvonok").click();})
$(window).resize(function(){});$("#nav_img_show_menu").click(function(event){if($("#md_mnu").hasClass("d-none"))$("#md_mnu").removeClass("d-none");else
$("#md_mnu").addClass("d-none");})});