<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>5</title>
<link rel="stylesheet" type="text/css" href="css/stage.css" />
<script src="jslibs/jquery-1.9.1.min.js"></script>
<script>
$(document).click(function(event) {
var x = event.offsetX,
y = event.offsetY;
$('#player').animate({
top: y,
left: x
}, 1000);
$('#change').html('hello');
});
</script>
</head>
<body>
<div id="header">
<h1 id="change">Mario is standing still...</h1>
</div>
<div id="stage">
<img id="player" src="images/mario.gif" alt="Mario" />
</div>
</body>
</html>
那是我的代码,但是当我单击它时,它只会永久更改为 hello,我希望它仅更改为 hello 1000 毫秒。我一直在到处寻找 jqueryAPI、google、任何地方。我就是不能让它发生。有人有想法么?
谢谢!