:-)疑い悪いユーザビリティのように聞こえるので、あなたは、これを行うための十分な理由を持っている信頼:
MooToolsのソリューションは、このようになります。決定的な働きかけの答えです。余分な親DIVを作成する必要はなく、id = "place_here"という名前を付けました。テーブルセルid = "place_here"に命名し、DIV id = "div_2"の親にすることで十分でした。 これは素晴らしい作品です。別のスレッドの誰かが私にこれを手伝ってくれました。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"><head>
<title>test/crtp</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
position_mdiv()();
$(window).resize(function() {
position_mdiv();
});
})
function position_mdiv(){
var pos = $('#place_here').position();
var width = $('#place_here').outerWidth();
$('#div_2').css({
position: "absolute",
top: pos.top +2 + "px",
left: (pos.left -300 + width) + "px"
});
}
</script>
<body>
<form id="CTRP_Form">
<table border="1">
<tr>
<td>
<div id="div_1"><input id="fnam" name="fnam" form="CTRP_Form" type="text"><input type=submit></div>
</td>
<td id="place_here" style="background:yellow;width:300px;padding:0px;border:solid 2px #CCC"></td>
</tr>
</table>
</form>
<div id="div_2"><form id="query_Form"><input id="MyQuery" name="MyQuery" form="query_Form" type="text"><input type=submit></form></div>
</body>
</html>
スニペット? 2つの別々のフォームを持つことで何が問題になりますか? –
あなたがしようとしていることについてさらに詳しく述べるならば、自分自身と他の人が喜んで別の解決策を提案すると確信しています。 –
http://stackoverflow.com/q/555928/684229の重複はありますか? – TMS