1
私は報告/コメントの報告システムを作成したいと思います。ポップアップをクリックし、クリックしたリンクの情報を入力してください
この時点で、私はちょうどhideidの内側のフィールドにcommentidを送信し、クリックした "フラグ"リンクの隣に表示されるポップを表示します。
<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>
が、その動作していない任意のアイデア
私は各コメントに沿ってこのようなものを持っている:(How to position one element relative to another with jQuery?から取られましたか)?
あなたは要素のZ-INDEXを確認しましたか? – Nazariy
うん、これは私のリンク上の2番目の答えを使用して作業を得た、プラス他の問題はすでにid = menuで他の何かを持っていた!それは私に頭痛も与えていた! – raklos