:-) 나쁜 유용성 같은 의심 소리 때문에,이 작업을 수행하는 좋은 이유가 신뢰 :
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>
니펫을? 두 개의 별개의 양식을 가지고 무엇이 잘못 되었습니까? –
시도하고있는 것에 대해 더 자세히 설명해 주시면 나 자신과 다른 사람들이 기꺼이 대체 솔루션을 제안 할 것이라고 확신합니다. –
중복 된 http://stackoverflow.com/q/555928/684229? – TMS