-
Notifications
You must be signed in to change notification settings - Fork 0
/
catch me if you can bg.html
34 lines (34 loc) · 1.03 KB
/
catch me if you can bg.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script src="catch me.js"></script>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.block
{
position: absolute;
left: 50px;
width: 130px;
height: 30px;
margin: 5px;
}
body {
background-color: red;
}
</style>
<script src="ReferencetoYourJqueryFile" type="text/javascript"></script>
</head>
<body>
<div class="block">
<input type="button" name="btnClick" value="Catch me" style="width: 100px;
height: 100px;border: 4px solid black; background-color: yellow" />
</div>
<script type="text/javascript">
$(".block").mouseover(function () {
$(".block").animate({
left:(Math.random()*1000),
top:(Math.random()*450),
}, "fast");
});
</script>
</body>
</html>