A sentimental robot

Mouse Cursor Image 본문

Web

Mouse Cursor Image

GOD03219 2017. 12. 26. 18:14

<!DOCTYPE html>
<html>
<head>
 <title>MouseCur</title>

 <script>
 window.onmousemove=function(event){
   var div=document.getElementById('div');
   div.style.visibility='visible';
   div.style.left=event.x+"px";
   div.style.top=event.y+"px";
}
 </script>

</head>
<body>
The image is following the mouse cursor.
<div id="div" style=" position: absolute; visibility:hidden;"><img src="./media/apple.png" style="width:30px; height:30px;"></div>
</body>
</html>

'Web' 카테고리의 다른 글

Calculator ver.2  (0) 2018.10.18
Javascript ex2  (0) 2018.10.18
Javascript ex1  (0) 2018.10.17
HTML 회원가입  (0) 2018.10.17
Calculator  (0) 2017.12.26