我扩展一个插件,目前就剩下这个问题,是这样的:这个问题单独拿出来:
<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

解决方案 »

  1.   

    <div id="rrr" style="width:30px; height:30px;background-color:#ccc;position:"></div> 
    这的position没写全,写上试试
      

  2.   

    <div id="rrr" style="width:30px; height:30px;background-color:#ccc;position:"></div> 
    这的position没写全,写上试试
    哦,我写忙了,没有那个属性了,现在解决了,把注册事件的代码调换下位子就好了,但是现在是这个测试程序好了,我的源程序还没有解决问题。。