[html] 第457天 写一个鼠标跟随的特效
Opened this issue · 1 comments
haizhilin2013 commented
zhaofeipeter commented
<!doctype html>
<style> #pionter{ width: 20px; height: 20px; background: pink; border-radius: 20px; position:absolute; } </style></head>
<body>
<div id="pionter"></div>
<script>
window.onload = function(){
var pionter = document.querySelector('#pionter');
window.onmousemove =function(e){
pionter['style']['left'] = e.clientX +'px';
pionter['style']['top'] = e.clientY +'px';
};
};
</script>
</body>