标签:style java color os io re c cti
<head>
<title></title>
<script type="text/javascript">
document.onmousemove =function() { //当鼠标移动式获取当前x,y坐标值
var x = window.event.clientX;
var y = window.event.clientY;
var f = document.getElementById("fly"); //取到id为fly的标签内容赋值于f
if (!f) { //如果没有取到,则返回
return;
}
f.style.left = x; //否则将f的坐标设为鼠标坐标值x,y
f.style.top = y;
}
</script>
</head>
<body>
<div id="fly" style="position: absolute">
<img src="300png016.png"/><br />
哈哈!我会飞!
</div>
</body>
标签:style java color os io re c cti
原文地址:http://www.cnblogs.com/renyanlei/p/3865391.html