This repository has been archived by the owner on Sep 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex3.html
92 lines (91 loc) · 2.65 KB
/
ex3.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 3</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
div {
margin: 1em;
padding: 5px;
border: 1px solid #ddd;
}
.woot{
color: #f00;
}
#third-div {
height: 3em;
}
</style>
<script type="text/javascript" src="wootquery.js"></script>
<script type="text/javascript">
// jQuery Input:
$(document).ready(function(){
$("li").hover(
function () {
$(this).append("<span class='woot'> Double-click me to make me disappear forever!</span>");
},
function () {
$(this).find("span:last").remove();
}
);
$("li").dblclick(function(){
$(this).remove();
});
$("#p1").click(function(){
$(this).html("Saung: \"I'm cool!\"");
$('#p2').html("Karl: \"And I'm not :(\"");
});
$("#p2").click(function(){
$(this).html("Karl: \"I'm cool now!\"");
$('#p1').html("Saung: \"Now I'm not :(\"");
});
$("#p1").hover(
function(){
$(this).append("<span class='woot'> Click me to make Saung cool and Karl not!</span>");
},
function(){
$(this).find("span:last").remove();
}
);
$("#p2").hover(
function(){
$(this).append("<span class='woot'> Click me to make Karl cool and Saung not!</span>");
},
function(){
$(this).find("span:last").remove();
}
);
p3 = $("#p3");
$("#third-div").hover(
function(){
$(this).html("");
},
function(){
$(this).append(p3);
}
);
});
</script>
</head>
<body>
<h1>Welcome to the Show</h1>
<p> Hover over the text below to see what you can do!</p>
<div id="first-div">
<p id="p1"> Saung: "Welcome!" </p>
<p id="p2"> Karl: "Welcome!" </p>
</div>
<div id="second-div">
<ul>
<li>List element 1</li>
<li>List element 2</li>
<li>List element THREE</li>
</ul>
</div>
<div id="third-div">
<p id="p3">Hover over me to make me fade away! </p>
</div>
</body>
</html>