onDragOver

書式

<タグ名 onDragOver="イベント発生時の処理">
オブジェクト.ondragover = "イベント発生時の処理"

説明

ドラッグ可能なオブジェクトに重なっている時に発生します。Windows版Internet Explorer 5以降、Safariで利用することができます。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<script type="text/javascript"><!--
window.onload = function() {
document.getElementById("imgObj").ondragover = function() {
document.getElementById("result").innerHTML = "Drag Over";
}
}
// --></script>
</head>
<body>
<div id="result"></div>
<img src="photo.jpg" id="imgObj" width="300" height="195">
</body>
</html>