1
我想知道如何將一個隱藏的盒子div放入當前焦點的輸入文本?把一個隱藏的盒子放入一個焦點輸入與jquery
<input type="text" class="target" name="some_name">
<input type="text" class="target" name="other_name">
<input type="text" class="target" name="another_name">
<input type="text" class="target" name="some_other_name">
other HTML ....
<div id="hidden">This div is hidden somewhere in the page,
and only visible if any of the above input text is in focus.
Once another input is in focus, this box is moved
relatively positioned (next, top or bottom) to the focus input.
This should be hidden if no input is in focus.</div>
我注意到一個插件:http://benalman.com/projects/jquery-outside-events-plugin/ 但不知道如果這是我需要的。
任何暗示或方向是非常讚賞。由於
謝謝。現在將進行測試。我已經澄清了我的問題,對不清楚的問題感到抱歉。 – swan 2012-02-03 11:43:34
我修改爲$(「input.target」)....,但隱藏的div是用類「目標」替換我的輸入文本。也許我錯過了什麼 – swan 2012-02-03 11:56:17
嗯,我的問題是這些輸入被放置在許多fieldset,其他divs和表單項。實際上並沒有取代,但隱藏的div位置並不好: element.style { display:none;/*這改變了阻止對焦,很好*/ left:494.767px; position:absolute; top:1029.68px; } – swan 2012-02-03 12:07:34