[英]How can I make an inner div trigger a drag effect on an outer div using Jquery?
I want to use an inner div to drag around an outer div, for example: 我想使用内部div来拖动外部div,例如:
<div id="outerDiv" style="height:300px; width:200px;">
<div id="innerDiv" style="height:10px; width:200px;"></div>
</div>
If this is my code, assuming the proper JQuery plugins are attached to use draggable, etc... How can I make it so that when the user clicks and drags the innerDiv, it drags the entire outerDiv. 如果这是我的代码,假设附加了正确的JQuery插件以使用draggable等...我怎么能这样做,以便当用户点击并拖动innerDiv时,它会拖动整个outerDiv。 But so that when the user clicks and tries to drag the outerDiv, it doesn't work.
但是,当用户单击并尝试拖动outerDiv时,它不起作用。
Basically I want the innerDiv to control the draggability of the outerDiv. 基本上我希望innerDiv控制outerDiv的可拖动性。
Any Ideas? 有任何想法吗?
Thanks, 谢谢,
Matt 马特
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.