画面上に画像を動的に配置しています。各画像には、そのサイズを変更するための +/- ボタンがあります (div マウスオーバーで画像の上に表示されます)。各画像はドラッグ可能である必要があります。
私のjavascriptは、imgを次のように設定すると正常に機能class="drag"
しますが、divでは機能しません-明らかにボタンもドラッグしたいです。以下は html フラグメントです ( div
with内にありますposition:relative
):
<div class="drag" onmouseover="showDIVChild(this)" onmouseout="hideDIVChild(this)">
<img id="my_img_1" style="width:100; height:100;" src="http://www.whatever.com/images/whatever.jpg"/>
<button id="but_A_1" style="display:none; width:10;height:15; position:absolute; left:5px; top:5px;" onClick="upSizeIMG('my_img_1')">+</button>
<button id="but_B_1" style="display:none; width:10;height:15; position:absolute; left:20px; top:5px;" onClick="downSizeIMG('my_img_1')">-</button>
</div>
Luke Breuerが提供する Javascript を使用しています。NB「ドラッグ」クラスはposition:absolute
CSS で設定されています。
なぜdiv
ドラッグしないのですか?(その他の機能はすべて動作しています)