<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="css/mail.css" rel="stylesheet" type="text/css" /> <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $(".in_text").click(function(){ var input = $("<input type='text' id='addr_text' onkeyup='IsNum(this)' readonly>"); if($("#addr_text").length == 0) {input.appendTo($(this));} $("#addr_text").focus(); }); }) function GetInfor(obj){ var name = $(obj).text(); var phone = $(obj).attr("name"); var div = $("<div class='per_infor' onclick='changeClass(this);'><span class='per_name'>"+name+"</span><span class='phone'>"+phone+"</span>;</div>"); var input = $("<input type='text' id='addr_text' onkeyup='IsNum(this)'>"); if($("#addr_text").length == 0) {input.appendTo($(".in_text"));} $("#addr_text").before(div); $("#addr_text").focus(); $(".per_infor").hover(function(){ $(this).addClass("BgColor"); },function(){$(this).removeClass("BgColor")}); $("#addr_text").blur(function(){ $(this).remove(); }); /*$(".per_infor").click(function(){ $("#addr_text").remove(); $(this).addClass("selected"); })*/ } function changeClass(domObj) { $(".per_infor").removeClass("selected"); $("#addr_text").remove(); $(domObj).addClass("selected"); } function isKeyPressed(event) { if (event.keyCode==37) { var dom1 = $("#addr_text").prev(); $("#addr_text").after(dom1); } else if(event.keyCode==39 ) { var dom1 = $("#addr_text").next(); $("#addr_text").before(dom1); } if(event.keyCode==8 ) { var dom1 = $("#addr_text").prev(); if($(".selected").length >0) {$(".selected").remove();} else {dom1.remove();} } else if(event.keyCode==46) { var dom1 = $("#addr_text").next(); dom1.remove(); } } </script> <title>个人中心邮件</title> </head> <body onkeyup="isKeyPressed(event)"> <div class="in_text"> </div> </body> </html>
?