-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathricardos2.html
58 lines (47 loc) · 1.08 KB
/
ricardos2.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<head>
<style>
div {
width:100px;
height:100px;
float:left;
margin:10px;
font-family:consolas;
padding:10px;
}
#lucy {
background-color:orange;
cursor:pointer;
}
#ricky {
background-color:grey;
cursor: pointer;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div id='lucy' class='ricardo'>Lucy Ricardo</div>
<div id='ricky' class='ricardo'>Ricky Ricardo</div>
<script>
// give lucy a blue border when clicked
$('#lucy').click(function() {
$('#lucy').css('border', '3px solid blue');
});
// make lucy's opacity 50% when hovered
$('#lucy').hover(
function(){
$('#lucy').css('opacity', '0.5');
});
// when either lucy or ricky are clicked, change the height of lucy to 300px
$('.ricardo').click(function() {
$('#lucy').css('height', '300px');
});
// when lucy or ricky are clicked, make them disappear
$('.ricardo').click(function() {
$('.ricardo').css('display', 'none');
});
</script>
</body>
</html>