我试图用 gif 文件制作鼠标效果,我发现了以下代码:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(function(){
$("body").mousemove(
function(e){
$("<img src='http://www.favicon.cc/logo3d/618187.png' />")
.css({
'position':'absolute',
'top':e.pageY+5,
'left':e.pageX+-15,
'width':'30px',
'height':'30px'
}).prependTo( $(document.body))
.fadeOut(100, 'linear', function(){
$(this).remove();
});
});
});
</script>
</body>
当我运行 html 文件时,我看不到任何东西,为此,我认为我在代码中犯了一个错误,有人可以帮我修复吗?
最佳答案
关于javascript - 如何在 HTML 中添加 JQuery 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18729515/