【发布时间】:2014-01-15 14:28:37
【问题描述】:
是否可以让 div 上下移动并在上下切换时更改 ID 的值?
前:
<div id="main_window">
<div id="window_1"> //this window moves down and also
<input id="var_1"> //gets the value of "3" from the div below
</div>
<div id="window_3"> //this window moves up and also
<select id="var_3"></select> //gets the value of "1" from the div above
</div>
<div id="window_6">
<textarea id="var_6"></textarea>
</div>
<div id="window_8">
<input id="var_7">
</div>
</div>
向上推的 div 应该获取最高的 id/name 值,但不能只切换 id 变量的内容。
只要完成目标,就可以通过点击或拖动来完成移动事件
【问题讨论】:
-
您是通过拖放或点击任何事件来移动 div?
-
放下或点击,只要目标可以完成
-
您没有编写任何 javascript...您应该自己尝试解决问题...是的,有可能...
-
这就是为什么我问这是否可能,因为我还没有这样做。
标签: javascript jquery html toggle moveabletype