$(function() { $('input,textarea').blur(function(){ $(this).closest('.info').removeClass('error') }) $('.book_submit').click(function() { var acount = 0 var wrapper=$(this).closest('.worder_wrapper_inner') wrapper.find('input,textarea').each(function() { var v = $(this).val() if (!v&&$(this).hasClass('req')) { acount++ $(this).closest('.info').addClass('error') } }) if (!acount) { var form_data={ 'username':wrapper.find('input[name="username"]').val(), 'phone':wrapper.find('input[name="phone"]').val(), 'email':wrapper.find('input[name="email"]').val(), 'beizhu':wrapper.find('textarea[name="beizhu"]').val(), 'companyname':wrapper.find('input[name="companyname"]').val(), 'yzm':wrapper.find('input[name="yzm"]').val(), } $.post('/booksubmit',form_data,function(data){ if(data.code==0){ alert(data.msg) return } $('.contact_fixed').hide() $('.liuyan_success').show() }) } }) $('.close_').click(function(){ $(this).closest('.worder_wrapper_inner').hide() }) $('.close_1').click(function(){ $('.liuyan_success').hide() }) $('.liuyan_success .btn').click(function(){ $('.liuyan_success').hide() }) $('.liuyan_lit').click(function(){ $('.contact_fixed').show() }) if ($(window).width() > 1000) { $('.navbar .menu').hover(function() { $(this).find('.sub_menu').stop().slideDown() $(this).find('.sub_menu_product').stop().slideDown() }, function() { $(this).find('.sub_menu').stop().slideUp() $(this).find('.sub_menu_product').stop().slideUp() }) } else { $('.navbar .menu i').click(function() { if (!$(this).closest('.menu').find('.sub_menu').is(":visible")) { $(this).closest('.menu').siblings().removeClass('active').find('.sub_menu').hide() $(this).closest('.menu').addClass('active').find('.sub_menu').stop().slideDown() } else { $(this).closest('.menu').addClass('active').find('.sub_menu').stop().slideUp() } }) } /*鍑哄叆鍔ㄧ敾*/ $('.animate__animated_adj').each(function() { //$(this).css({ 'opacity': 0, 'visibility': 'hidden', "transform":"matrix(1, 0, 0, 1, 0, 40)" }) }) var scrolltop = $(window).scrollTop() $('.animate__animated_adj').each(function() { var this_top = $(this).offset().top var wh=$(this).height()*0.5 if(wh>50) wh=50 console.log(this_top) console.log($(window).height() - wh) if ((scrolltop * 1 + $(window).height() - wh) > this_top) { $(this).css({ 'opacity': 1, 'visibility': 'inherit', "transform":"matrix(1, 0, 0, 1, 0, 0)" }) } }) $(window).scroll(function() { var scrolltop = $(window).scrollTop() if ($(window).width() > 0) { if (scrolltop > 0) { $('.navbar').addClass('fixed') } else { $('.navbar').removeClass('fixed') } } $('.animate__animated').each(function() { var this_top = $(this).offset().top var wh=$(this).height()*0.5 if(wh>50) wh=50 if ((scrolltop * 1 + $(window).height() - wh) > this_top) { /*$(this).css({ 'opacity': 1 })*/ $(this).addClass($(this).data('animate')) } }) $('.animate__animated_adj').each(function() { var this_top = $(this).offset().top var wh=$(this).height()*0.5 if(wh>50) wh=50 if ((scrolltop * 1 + $(window).height() - wh) > this_top) { $(this).css({ 'opacity': 1, 'visibility': 'inherit', "transform":"matrix(1, 0, 0, 1, 0, 0)" }) } }) $('.animate__animated_adj_wrapper').each(function() { var this_top = $(this).offset().top if ((scrolltop * 1 + $(window).height() - $(this).height()*0.5) > this_top) { var index=0 $(this).find('.animate__animated_adj_item').each(function(){ var that=this setTimeout(function(){ $(that).css({ 'opacity': 1, 'visibility': 'inherit', "transform":"matrix(1, 0, 0, 1, 0, 0)" }) },0*(index++)) }) } }) }) var scrolltop = $(window).scrollTop() $('.animate__animated').each(function() { var this_top = $(this).offset().top if ((scrolltop * 1 + $(window).height() - 180) > this_top) { if ($(this).hasClass('animate__animated_timeout')) { var that = this setTimeout(function() { $(that).addClass($(that).data('animate')) }, $(that).attr('timeout')) } else { $(this).addClass($(this).data('animate')) } } }) $('.yuexiang_list li').hover(function() { $(this).addClass('active').siblings().removeClass('active') }) /*鍥炲埌椤堕儴*/ $(".totop").click(function() { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); $('.breadcumb a:last').addClass('last') $('.position_list .header .col8').click(function(){ var p=$(this).closest('.position_list_block').toggleClass('thisactive') }) })