CSS
.show
{
z-index:9999;
position:fixed;
}
body
<p onmouseover="mover(this,'.....')">Text</p>
<div id='kk'>
......
</div>
javascript
function mover(event, val) {
var div = document.getElementById("kk");
var event = window.event || event;
div.style.left = 10 + event.clientX + "px";//"px"必须
div.style.top = 10 + event.clientY + "px";//"px"必须
div.innerHTML = val;
div.className = "show";
}
function out() {
document.getElementById("kk").className = "none";
}
沒有留言:
張貼留言