// $(document).ready(function(){ // var $body = $('body'); // var wi = $(window).width(); // if(750div', function(e) { e.stoppropagation(); }); } $(window).scroll(function(e){ p = $(this).scrolltop(); if(p > 0){ $('#header').addclass('cur'); }else{ $('#header').removeclass('cur'); } if(t<=p){ //向下滚 $('#header').addclass('none'); }else{ //向上滚 $('#header').removeclass('none'); } if(p == 0){ $('#header').removeclass('none'); } settimeout(function(){t = p;},0); }); }, // 手机版头部搜索 m_search: function(){ var wi = $(window).width(); if(wi<=1024){ $(document).on('click','#header .head .icon .mb-search',function(){ $('#search-box').slidetoggle(); $(this).toggleclass('cur'); }); } }, m_search_nav: function(){ $(window).scroll(function(e){ p = $(this).scrolltop(); if(p > 0 && $('#header .head .icon .mb-search').hasclass('cur')){ $('#header .head .icon .mb-search').removeclass('cur'); $('#search-box').slideup('fast'); } settimeout(function(){t = p;},0); }); }, }; // 二级菜单 $(document).on('hover', '#header .point .dd', function () { var o_h = $(this).find('.two').outerheight(); if($(this).hasclass('cur')){ $(this).removeclass('cur'); $(this).find('.menu').height(0); }else{ $(this).addclass('cur'); $(this).find('.menu').height(o_h); } }); // 首页关于我们文字滚动 $(document).ready(function () { $(window).scroll(function(){ title(); }); function title(){ var ws=$(window).scrolltop(); $('.scroll-bg .tit-white').each(function(){ if($(this).hasclass('shu')){ var whitetit1 = $(this); whitetit1.css('transform', 'translate3d(0px, -'+(ws/1.5)+'px, 0px)'); } }); } title(); }); // // $(function(){ // $(window).scroll(function(){ // var s_top = $(window).scrolltop(); // var nav_h1 = $('.index-wrap .sli1').outerheight(); // var nav_h2 = $('.index-wrap .sli2').outerheight(); // var nav_h3 = $('.index-wrap .sli3').outerheight(); // var nav_h4 = $('.index-wrap .sli4').outerheight(); // var nav_h5 = $('.index-wrap .sli5').outerheight(); // // var nav_h2 = $('#news-detail .news-part1').outerheight(); // var nav_h = nav_h1 + nav_h2 + nav_h3 + nav_h4 + nav_h5; // if(s_top >= nav_h){ // $('#top_head').addclass('hide'); // $('#header').addclass('hide'); // } // // if(s_top >= nav_h){ // // if(!($('#top_head').hasclass('hide'))){ // // $('#inquiry').height('100%'); // // $('#inquiry').addclass('in'); // // } // // }else{ // // if($('#inquiry').hasclass('in')){ // // $('#inquiry').removeclass('in'); // // $('#inquiry').height(0); // // } // // } // }); // }); // 底部 if ($(window).width()<=1024) { // 底部点击 $(document).on('click',"#footer .fnav .fnav-one",function(){ var fnav = $(this).parent(); var o_h = fnav.find('.h').outerheight(); if (fnav.hasclass('in')) { fnav.removeclass('in'); fnav.find('.fnav-two').height(0); }else{ $('#footer .ftop .fleft .fnav').removeclass('in'); $('#footer .ftop .fleft .fnav').find('.fnav-two').height(0); fnav.addclass('in'); fnav.find('.fnav-two').height(o_h); } }); }; // 友情链接 var link = { select:function(){ $('#footer .fbot .fbot-right .select .con').click(function(){ if($(this).parent('.select').hasclass('cur')){ $(this).parent('.select').removeclass('cur'); $(this).parent('.select').find('.list').height(0); }else{ $(this).parent('.select').addclass('cur'); var h = $(this).parent('.select').find('.h').height(); $(this).parent('.select').find('.list').height(h); } }) $('#footer .fbot .fbot-right .select .list .a').click(function(){ $(this).parents('#footer .fbot .fbot-right .select').find('.con').text($(this).text()); $(this).parents('#footer .fbot .fbot-right .select').removeclass('cur'); $(this).parents('#footer .fbot .fbot-right .select .list').height(0); }); $('body').on('click',function (e) { var obj = $(e.target); if(obj.closest("#footer .fbot .fbot-right .select.cur").length < 1){ $('#footer .fbot .fbot-right .select').removeclass('cur'); $('#footer .fbot .fbot-right .select .list').height(0); } }); }, }; $(window).load(function(){link.select();}); // 联系我们 $(document).on('click','#contact_list .li',function(){ $(this).addclass('cur').siblings().removeclass('cur'); var id = $(this).data('id'); $.get('/ajax/map', {id:id}, function (data){ $('#contact_map .map').html(data); }); }); /* recruitment */ $(document).on('click', '#recruitment .item.tbody', function(){ $(this).toggleclass('cur').next().stop().slidetoggle(); $(this).next().parent().siblings().children(".con").slideup(); $(this).next().parent().siblings().children(".item").removeclass("cur") }) // 资源中心-样品申请 $(document).on('submit', '#sample .form_box', function(){ if (!$('body').is('.is-load-over')) { // 这里是为了检查jext的组件是否加载完毕了没有 $.alert('还没准备好,稍后提交!', 3000); return false; } var form = $(this); var check = form.check_form(); if (check) { // 请移步,check_form() // console.log(check[0]['el']); $.alert(check[0].tip, 3000); return false; } var serialize = $(this).serializearray(); $.async('post', '/api/web/apply', serialize, function(result){ // console.log(result); if (result.ret==1) { form[0].reset(); $.alert(result.msg, 3000); $('#sample .form_box .item .con').show(); }else{ $.alert(result.msg, 3000); } }, 'json'); return false; });