Dan*_*ges 2 drag-and-drop draggable html5-video
我有这种类型的元素:
<div draggable="true" id="item" style="margin:20px;background:red;height:400px;width:400px;">
<a href="#" target="_blank">
<img style="margin:40px;" src="http://www.placekitten.com/100/100" alt="">
</a>
</div>
Run Code Online (Sandbox Code Playgroud)
我希望能够:
现在,我点击它时只拖动图像.
这是一个小提琴:http://jsfiddle.net/M5tBd/
根据HTML5编辑器的草案规范,带有href元素的图像和锚点都是默认可拖动的元素.你的主播可能正在捕捉dragstart事件,阻止div获得它.尝试设置可拖动=你的"假" <img>和<a>元素.
<div draggable="true" id="item" style="margin:20px;background:red;height:400px;width:400px;">
<a href="#" target="_blank" draggable="false">
<img style="margin:40px;" src="http://www.placekitten.com/100/100" alt="" draggable="false">
</a>
Run Code Online (Sandbox Code Playgroud)
你的小提琴甚至不能在Ubuntu下为我在Chrome中拖动img元素,所以你可能还有其他问题.
| 归档时间: |
|
| 查看次数: |
2555 次 |
| 最近记录: |