我扩展一个插件,目前就剩下这个问题,是这样的:这个问题单独拿出来:
<div id="one" style=" height:500px; width:500px;position:absolute; overflow:scroll;">
<div id="rrr" style="width:30px; height:30px;background-color:#ccc;position:"></div>
<br>
<div class="ttt" style=" height:10px; width:10px; background-color:#000000;">
</div>
截图:然后是jquery脚本:
$(function() {
$(".ttt").draggable({
cursor : 'move',
distance : 1,
helper : 'clone',
opacity : 0.8,
revert : 'invalid',
revertDuration : 200,
snap : 'div.rrr.expanded',
snapMode : 'outer',
stack : '.ttt'
});
$("#one").droppable({
accept:'.ttt',
drop:function( event, ui ) {
alert("one");
}
});
$("#rrr").droppable({
accept:'.ttt',
drop:function( event, ui ) {
alert("rrr");
});
});
问题:我将黑色拖放到灰色div之中释放,结果被one接收了。怎么解决这个问题啊?z轴什么的都不管用。大家看有没有这问题的经验。头一次用jquery-ui想了一上午了,总感觉就是被id=one的div挡住了。但是怎么想怎么觉得最外层div应该是在最下层啊...纠结的很。$("#rrr").click(function(event){
alert("rrr");
event.stopPropagation();
});
$("#one").click(function(){
alert("one");});
我又放置了两个点击事件,结果告诉我灰色的div是在大div上面的、、为什么释放的时候会被下层div接收到而不是上层呢?怎么解决。
jquery ui jquery拖放div
<div id="one" style=" height:500px; width:500px;position:absolute; overflow:scroll;">
<div id="rrr" style="width:30px; height:30px;background-color:#ccc;position:"></div>
<br>
<div class="ttt" style=" height:10px; width:10px; background-color:#000000;">
</div>
截图:然后是jquery脚本:
$(function() {
$(".ttt").draggable({
cursor : 'move',
distance : 1,
helper : 'clone',
opacity : 0.8,
revert : 'invalid',
revertDuration : 200,
snap : 'div.rrr.expanded',
snapMode : 'outer',
stack : '.ttt'
});
$("#one").droppable({
accept:'.ttt',
drop:function( event, ui ) {
alert("one");
}
});
$("#rrr").droppable({
accept:'.ttt',
drop:function( event, ui ) {
alert("rrr");
});
});
问题:我将黑色拖放到灰色div之中释放,结果被one接收了。怎么解决这个问题啊?z轴什么的都不管用。大家看有没有这问题的经验。头一次用jquery-ui想了一上午了,总感觉就是被id=one的div挡住了。但是怎么想怎么觉得最外层div应该是在最下层啊...纠结的很。$("#rrr").click(function(event){
alert("rrr");
event.stopPropagation();
});
$("#one").click(function(){
alert("one");});
我又放置了两个点击事件,结果告诉我灰色的div是在大div上面的、、为什么释放的时候会被下层div接收到而不是上层呢?怎么解决。
jquery ui jquery拖放div
解决方案 »
- extjs4.1中用ajax方式返回treepanel的store数据后一直显示加载状态,求帮助!!
- button元素的id与onclick要调用的函数名字相同
- 关于网页划词搜索,看过163和qq的新闻页面,
- [求助]如何处理同级别的dom事件流?
- 在网页中JS如何创建INPUT元素.
- 难题问高手:如何用js代码实现禁用iframe
- 有很多父元素,offsetTop能不能直接获取 对象 相对于window的位置?
- location.href的问题.!!(急在线等各位的解答)谢谢.
- 只有高手才能回答这个问题
- JavaScript正则表达式问题
- Ext.Panel 可以设置成半透明的吗
- 我有一个百度地图的问题
这的position没写全,写上试试
这的position没写全,写上试试
哦,我写忙了,没有那个属性了,现在解决了,把注册事件的代码调换下位子就好了,但是现在是这个测试程序好了,我的源程序还没有解决问题。。