代码: 复制代码 代码如下: <BR>#choice_list_district{ height:50px;} <BR>#tab td{cursor:pointer;} <BR> <BR>$(function () { <BR>//绑定事件处理 <BR>$("#choice_list_district a").click(function (e) { <BR>if ($("#divObj").css("display") == "none") { <BR>e.stopPropagation(); <BR>//设置弹出层位置 <BR>var offset = $(e.target).offset(); <BR>//设置弹出层位置在点击的下面 <BR>$("#divObj").css({ top: offset.top + $(e.target).height() + "px", left: offset.left }); <BR>$("#divObj").show(); <BR>} <BR>else { <BR>$("#divObj").hide(); <BR>} <BR>}); <BR>//单击空白区域隐藏弹出层 <BR>$(document).click(function (event) { $("#divObj").hide(); }); <BR>//单击弹出层则自身隐藏 <BR>//$("#divObj").click(function (event) { $("#divObj").hide(speed) }); <BR>$("#tab tr td").click(function (event) { <BR>$("#aaa").val($(this).html()); <BR>}); <BR>}); <BR> 出来层 aaa bbb