$(function(){ //导航 var thead=$('header').clone(true); $('body').append(thead); thead.addClass('h_fix'); $(window).scroll(function(){ var scrolltop=$(document).scrollTop() if(scrolltop>500){ $('.h_fix').slideDown(200); }else{ $('.h_fix').slideUp(200); } }); $(".pub_fix").after("
侧边导航
"); $(".index_blur").click(function(){ $(".pub_fix").animate({right:"-70px"},"slow",function(){ $(".right_cebian").show("fast"); }); }); $(".right_cebian").click(function(){ $(".right_cebian").hide("fast"); $(".pub_fix").animate({right:"20px"},"slow",function(){ }); }); //二级导航 $('.nav ul li').mouseenter(function(){ $(this).find('.subnavigation').slideDown(100); }); $('.nav ul li').mouseleave(function(){ $(this).find('.subnavigation').slideUp(100); $('.nav ul li').stop(false,true); }); //挂件 $('.pendent_box').click(function(e){ e.preventDefault(); $("body,html").animate({scrollTop:0},1000) }); //登陆页面 var hht=$(window).height(); $('.login').height(hht); $('#Lo_user').focus(function(){ $(this).css({color:'#333333'}) }) $('#Lo_pass').focus(function(){ $(this).val('').css({color:'#333333'}); }); $('#checks').attr('checked',true) $('#checks').click(function(){ var Cheack=$(this).prop('checked') if(Cheack){ $('#checks').attr('checked',true) $(this).parent().removeClass("lab_checkno").addClass("lab_check"); $('#checkst').prop('checked',false); $('#checkst').parent().removeClass("lab_check").addClass("lab_checkno"); } }) $('#checkst').click(function(){ var Cheack_no=$(this).prop('checked') if(Cheack_no){ $(this).parent().removeClass("lab_checkno").addClass("lab_check"); $('#checks').prop('checked',false); $('#checks').parent().removeClass("lab_check").addClass("lab_checkno"); } }) //点击x $('.log_del').click(function(){ $('#Lo_user').val(''); $('#Lo_user').focus(); $('#Lo_user').css({color:'#333333'}); }) // 登陆事件 $('.head_login').click(function(e){ e.preventDefault(); $('.login').fadeIn(800) $('#form_register').fadeOut(800) }) $('.login_close').click(function(){ $('.login').fadeOut(800) $('#form_register').fadeIn(800) }) $('#form_login').submit(function(e){ e.preventDefault(); var Suser=$('#Lo_user').val(); var Spass=$('#Lo_pass').val(); var check_experts=$('#checks').prop('checked'); var experts=check_experts?0:1; if(Suser==''||Spass==''||Suser=='用户名/邮箱/手机'||Spass=='请输入密码'){ return false; }else{ $.ajax({ method: "POST", dataType: "json", url: globalConfig.context + "/signin", data: { "mobile": Suser, "password": Spass, "type": experts, "remember": false, }, success: function (rest) { if (rest.error && rest.error.length) { $('#msg').val(rest.error[0].message); msg(); } else { var data = rest.data; if (data && data.requestURI) { var path = globalConfig.context + data.requestURI; if (data.queryString) { path += '?' + data.queryString; } if (window.location.hash) { path += window.location.hash; } window.location.href = path; } else { window.location.href = globalConfig.context + "/user/account/index.html"; } } } }) } }) //提示框渐隐函数 function msg(){ var lit=$('#msg').val(); if(lit!==''){ $('.smg').fadeIn(500) } setTimeout(function(){ $('.smg').fadeOut(500) $('#msg').val('') },2000) } //在线客服 (function(m, ei, q, i, a, j, s) { m[i] = m[i] || function() { (m[i].a = m[i].a || []).push(arguments) }; j = ei.createElement(q), s = ei.getElementsByTagName(q)[0]; j.async = true; j.charset = 'UTF-8'; j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t'; s.parentNode.insertBefore(j, s); })(window, document, 'script', '_MEIQIA'); _MEIQIA('entId', 77931); _MEIQIA('withoutBtn'); })