1
我想创建一个报告/标记注释的系统。加载弹出窗口并用点击链接填充信息
在这一点我只是得到它发送纪念到一个隐藏的div内的字段和点击“标志”链接旁边的弹出窗口。 (摘自:How to position one element relative to another with jQuery?)
我有这样的事情沿着每个评论:
<a class="flag" id="[email protected](item.ID)">flag</a>
,这对我的jquery:
$(".flag").click(function() {
var commentId = $(this).attr('id');
$("#comment-id-label").val(commentId);
//get the position of the placeholder element
var pos = ("#"+commentId).offset();
var width = ("#"+commentId).width();
//show the menu directly over the placeholder
$("#menu").css({ "left": (pos.left + width) + "px", "top": pos.top + "px" });
$("#menu").show();
});
<div style="position: absolute; display: none;" id="menu">
<input id="comment-id-label" type="text" value="" />
</div>
,但它不工作的任何想法?
你检查Z-INDEX元素? – Nazariy 2011-01-08 18:15:48