-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquery_hover_and_click.html
More file actions
55 lines (55 loc) · 1.89 KB
/
jquery_hover_and_click.html
File metadata and controls
55 lines (55 loc) · 1.89 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<title>jQuery - Hover and Click</title>
<style>
body {
background-image: url('images/space.gif');
repeat: no-repeat;
}
div {
height: 100px;
width: 100px;
border-radius: 100%;
background-color: #008800;
background-image: -webkit-gradient(linear,
0% 0%,
0% 100%,
from(#003500),
to(#008800));
background-image: -webkit-linear-gradient(left, #003500, #008800);
background-image: -moz-linear-gradient(left, #003500, #008800);
background-image: -ms-linear-gradient(left, #003500, #008800);
background-image: -o-linear-gradient(left, #003500, #008800);
}
.red {
background-color: #CC0000;
background-image: -webkit-gradient(linear,
0% 0%,
0% 100%,
from(#330000),
to(#CC0000));
background-image: -webkit-linear-gradient(left, #330000, #CC0000);
background-image: -moz-linear-gradient(left, #330000, #CC0000);
background-image: -ms-linear-gradient(left, #330000, #CC0000);
background-image: -o-linear-gradient(left, #330000, #CC0000);
}
</style>
<script src="js/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('div').hover(function() {
$(this).addClass('red');
});
$('div').click(function() {
$(this).fadeTo('fast', 0.5);
});
$('div').dblclick(function() {
$(this).fadeOut('fast');
});
});
</script>
</head>
<body>
<div></div>
</body>
</html>