IE支持HTML5 File API
IE9不支持FileAPI
IF10启动了受支持的文件API
一个例子就是拖放。现在,HTML5提供了拖放(DnD)API,该API为浏览器带来了本机DnD支持,从而使编写代码变得更加容易。
<!DOCTYPE HTML>
<html>
<head>
<style>
#boxA, #boxB { float:left;padding:10px;margin:10px; -moz-user-select:none; }
#boxA { background-color: #6633FF; width:75px; height:75px; }
#boxB { background-color: #FF6699; width:150px; height:150px; }
</style>
<script>
function dragStart(ev) {
ev.dataTransfer.effectAllowed='move';
ev.dataTransfer.setData("Text", ev.target.getAttribute('id'));
ev.dataTransfer.setDragImage(ev.target,0,0);
return true;
}
</script>
</head>
<body>
<center>
<h2>Drag and drop HTML5 demo</h2>
<div>Try to drag the purple box around.</div>
<div id = "boxA" draggable = "true"
ondragstart = "return dragStart(ev)">
<p>Drag Me</p>
</div>
<div id = "boxB">Dustbin</div>
</center>
</body>
</html>热门推荐
10 新大学开学祝福语简短
11 对别人新年祝福语简短
12 收到公公生日祝福语简短
13 歌词祝福语高级文案简短
14 升职祝福语朋友简短精辟
15 元旦祝福语简短有深度
16 兔年祝福语简短100字
17 贺卡祝福语情侣搞笑简短
18 酒店客人祝福语简短