easyUI中两个layout之间元素的拖拽(draggable)或节点被覆盖的原因

本文探讨了在 easyUI 的 layout 中,由于含有 `class="easyui-layout"` 导致的元素拖拽(draggable)时可能被覆盖的问题。举例展示了含有 layout 类的元素无法正确拖动到其他部分,包括 `id="edit"` 的方框无法移动到 `id="bottom"` 或 `class="easyui-panel"` 中。提供了测试代码以展示此现象。

Easyui的可拖拉(draggable)使用是由限制范围的那就是不能包含class="easyui-layout"

如果含有 class="easyui-layout",则可能被覆盖

如下例子中,id="edit"中的两个方框不会移动到id="bottom"中,也不会移动到class="easyui-panel"中。


测试代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic Draggable - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
<h2>Basic Draggable</h2>
<p>Move the boxes below by clicking on it with mouse.</p>
<div style="margin:20px 0;"></div>
<div id="cc" class="easyui-layout" style="height:220px">
<div id="bottom" data-options="region:'south'" style="padding:15px;split:true;height: 56px;">
</div>
<div data-options="region:'center'" title="123456" >
<div id="edit">
<div class="easyui-draggable" style="width:200px;height:50px;background:#fafafa;border:1px solid #ccc"></div>
<div class="easyui-draggable" style="width:200px;height:50px;background:#fafafa;border:1px solid #ccc;margin-top:10px">
</div>
</div>
</div>
</div>
</div>

<div class="easyui-panel" style="padding:5px;height:400px">
<div class="easyui-draggable" style="width:200px;height:50px;background:#fafafa;border:1px solid #ccc;margin-top:10px">
</div>
</div>

</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值