被拖拽元素覆盖问题
拖拽时,id="y"的div覆盖id="x"的div,反过来却不行,为什么
拖拽时,id="y"的div覆盖id="x"的div,反过来却不行,为什么
2015-04-08
<script type="text/javascript">
$(function () {
$("#x").draggable({containment:"parent",axis:"x"});
$("#y").draggable({containment:"parent",axis:"y"});
$("#x").bind('mousedown',function(){
initial();
$(this).css('z-index',100);
});
$("#y").bind('mousedown',function(){
initial();
$(this).css('z-index',100);
});
function initial(){
$('#x').css('z-index',0);
$('#y').css('z-index',0)
}
});
</script>
设置了还是有问题,求指正哪里错啦???
<script type="text/javascript"> $(function () { $("#xy").draggable({containment:"parent"}); $("#x").draggable({containment:"parent",axis:"x"}); $("#y").draggable({containment:"parent",axis:"y"}); $("#xy").mousedown(function(){ z-index:1100; }); $("#x").mousedown(function(){ z-index:100; }); $("#y").mousedown(function(){ z-index:200; }); }); </script>
举报