我想與兄弟img做一個拖拽框,'move-obj'可以被拖拽。它在其他瀏覽器中正確運行,但IE( 8,9,10)。在IE中,只是當你將鼠標懸停在邊框可以拖動「移動 - 目標」,但如果去掉標籤「IMG」它的工作correctly.I發現,如果我添加背景色爲「移動 - 目標」,它也會正確運行,但它不是我想要的。有人能給我一些建議嗎?這裏是codepen拖動不起作用,當它在IE中有一個兄弟姐妹img
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.wrap{
position: relative;
width: 100%;
height: 100%;
background-color: #f0f0f0;
padding: 10%;
}
.wrap-inside{
position: relative;
width: 500px;
height: 500px;
border: 1px solid #ddd;
}
.move-obj{
cursor: move;
position: absolute;
width: 100px;
height: 100px;
border: 1px solid blue;
}
.bg{
width: 500px;
height: 500px;
position: absolute;
}
</style>
</head>
<body>
<div class="wrap">
<img class="bg" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTE2qkLv64zdI4z5uIbE1oSMmI0AiQcbwbhAYAyI0cF2Dwg88tb" alt="">
<div class="wrap-inside">
<div class="move-obj"></div>
</div>
</div>
</body>
</html>
我很抱歉沒有照亮問題,我添加了一些代碼到代碼筆。 Actuall我想拖動'move-obj',但它不適用於IE瀏覽器。 – yzajoee