现在有两个块,结构如下:
<div id = "outer" style = "width:50px;height:50px;">
<span id = "inner" style = "positon:absolute;buttom:0;right:0;width:5px;height:5px;">
</span>
</div>
如图:
https://mjj.today/i/TXCM5H
这两个块都监听了mousedown,mousemove,mouseup。
我想实现的功能
点击 outer 可以移动整个块,点击 inner 拖动可以控制 outer 块的宽高。
现状
如果我拖拽 inner 的话,outer 会在增加宽高的同时移动。
尝试过
增加一个状态控制 outer 不进行处理,但是无法实现两个功能同时存在。
这种情况有什么好的处理办法吗?用的原生的 js 。