function openLightbox() { $(".lightbox_back").css("display", "block"); $(".lightbox_fore").css("display", "block"); $("body").css("overflow", "hidden"); } function shutLightbox() { $(".lightbox_back").css("display", "none"); $(".lightbox_fore").css("display", "none"); $("body").css("overflow", "auto"); } $(function(){ $("input[name=userId]").keydown(function(e){ if(e.which === 13) { if($("input[name=pwdtip]").css("display")==="block"){ $("input[name=pwdtip]").focus(); } else{ $("input[name=password]").focus(); } } else{ $(this).css("color","#000000"); if($(this).val()==="学号/职工号/北大邮箱"){ $(this).val(""); } } }); $("input[name=userId]").blur(function(e){ if($(this).val()===""){ $(this).css("color",""); $(this).val("学号/职工号/北大邮箱"); } }); $("input[name=pwdtip]").keydown(function(e){ if(e.which === 13) { //进哪里? } else{ $(this).hide(); $("input[name=password]").show(); $("input[name=password]").focus(); } }); $("input[name=password]").blur(function(e){ if($(this).val()===""){ $(this).hide(); $("input[name=pwdtip]").show(); } }); $("#conn-opt").click(function(){ if($(this).children("i").hasClass("fa-toggle-on")){ $(this).children("i").addClass("fa-toggle-off"); $(this).children("i").removeClass("fa-toggle-on"); $(this).children("i").removeClass("pku-red"); $(this).children("i").addClass("pku-gray"); $("input[name=free]").val("yes"); } else{ $(this).children("i").addClass("fa-toggle-on"); $(this).children("i").addClass("pku-red") $(this).children("i").removeClass("fa-toggle-off"); $(this).children("i").removeClass("pku-gray"); $(this).children("i").addClass("pku-red"); $("input[name=free]").val("no"); } }); });