Chrome:在contenteditable div中拖放绝对div

时间:2016-01-13 07:25:14

标签: google-chrome drag-and-drop contenteditable

Chrome可以拖动吗?在一个可信的div中的绝对位置放一个div?

以下代码适用于Firefox和IE,但不适用于Chrome。

<!DOCTYPE html >
<html>
<head>
<script>
  //for IE
  document.execCommand("2D-position",false,true); 
</script>
</head>
<body>
<div contenteditable="true" style="background-color:blue;width:900px;height:400px;position:relative;">
  <div style="width:50px;height:50px;background-color:red;position:absolute;top:50px;"></div>
</div>
</body>
</html>

谢谢!

0 个答案:

没有答案