-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery_faq.html
249 lines (205 loc) · 9.4 KB
/
jquery_faq.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>10 FAQs about national parks</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<style>
.invisible {
visibility: hidden
}
</style>
<script src="js/jquery.js"></script>
</head>
<body>
<h1>10 FAQs about national parks</h1>
<button id="btn1" style="background-color: #0c5460; color: snow; font-size: larger">Toggle between classes</button>
<!--<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"-->
<!-- aria-hidden="true"> -->
<!--</div>-->
<div class="modal fade" id="overlay">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Hello</h4>
</div>
<div class="modal-body">
<p>Do you want to register?</p>
</div>
</div>
</div>
</div>
<!--<div>-->
<!-- <h1>Would you like to sign up for our newsletter? <span id="close">X</span></h1>-->
<!--</div>-->
<div id="register" class="alert alert-info mt-2" role="alert">Would you like to sign up for our newsletter? <span id="close">X</span></div>
<dl>
<dt>Who is the director of the National Park Service?</dt>
<dd class="invisible">
Frequently Asked Questions
Have questions? Start here for answers to frequently asked questions about:
The National Park Service
Visiting national parks (including entrance passes)
Miscellaneous topics
About the National Park Service
Who is the director of the National Park Service?
Dan Smith is the deputy director exercising the authority of director for the National Park Service.
Learn more about past directors of the National Park Service.
</dd>
</dl>
<dt>What government agency oversees the National Park Service?</dt>
<dd class="invisible">The National Park Service is a bureau of the Department of the Interior. Directly overseeing its
operation is
the department's Assistant Secretary for Fish, Wildlife and Parks.
</dd>
<dt>How many employees are in the National Park Service?</dt>
<dd class="invisible">
<ul>
<li>Permanent, temporary, and seasonal employees: More than 20,000
</li>
<li>Volunteers: More than 315,000 in 2017</li>
</ul>
</dd>
<dt>How old is the National Park System?</dt>
<dd class="invisible">The National Park Service was created by an act signed by President Woodrow Wilson on August 25,
1916.
Yellowstone National Park was established by an act signed by President Ulysses S. Grant on March 1, 1872,
as the nation's first national park. View the National Park System timeline.
</dd>
<dt>What is the origin of the National Park Service arrowhead?</dt>
<dd class="invisible">The arrowhead was authorized as the official National Park Service emblem by the Secretary of the
Interior on
July 20, 1951. The components of the arrowhead may have been inspired by key attributes of the National Park
System, with the sequoia tree and bison representing vegetation and wildlife, the mountains and water
representing scenic and recreational values, and the arrowhead itself representing historical and
archeological values. Read more about the history of the arrowhead and other elements of NPS visual design.
The NPS allows limited use of the NPS arrowhead when doing so contributes to our work. Learn how to request
permission to use the arrowhead.
</dd>
<dt>How many areas are in the National Park System?</dt>
<dd class="invisible">The system includes 419 areas covering more than 85 million acres in every state, the District of
Columbia,
American Samoa, Guam, Puerto Rico, and the Virgin Islands. These areas include national parks, monuments,
battlefields, military parks, historical parks, historic sites, lakeshores, seashores, recreation areas,
scenic rivers and trails, and the White House. Learn more about national park designations. See the complete
list of National Park Service units and affiliated areas by type and number.
</dd>
<dt>What is the largest national park site? Smallest?</dt>
<dd class="invisible">
<ul>
<li>Largest: Wrangell-St. Elias National Park and Preserve, AK, at 13.2 million acres
</li>
<li>Smallest: Thaddeus Kosciuszko National Memorial, PA, at 0.02 acres</li>
</ul>
</dd>
<dt>How many people visit the national parks?</dt>
<dd class="invisible">Total recreation visitors to the national parks in 2018: 318,211,833.</dd>
<dt>What is the most-visited national park?</dt>
<dd class="invisible">View a list of the most-visited sites in the National Park Service.</dd>
<dt>What is the National Park Service budget?</dt>
<dd class="invisible">
<ul>
<li>Fiscal Year (FY) 2014 Enacted: $2.98 billion
</li>
<li>FY 2015 Enacted: $2.615 billion</li>
<li>FY 2016 Enacted:$2.851 billion</li>
<li>FY 2017 Enacted: $2.932 billion</li>
</ul>
</dd>
</dl>
<button id="btn2" style="background-color: #0c5460; color: snow; font-size: larger">Last LI</button>
<h3 id="national-parks-heading">National Parks</h3>
<ul id="national-parks">
<li>Arches</li>
<li>Badlands</li>
<li>Carlsbad Caverns</li>
<li>Denali</li>
<li>Everglades</li>
</ul>
<h3>State Parks of Texas</h3>
<ul id="state-parks-texas">
<li>Abilene</li>
<li>Big Bend</li>
<li>Choke Canyon</li>
<li>Davis Mountains</li>
<li>Enchanted Rock</li>
</ul>
<script src="js/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script>
(function () {
$(document).ready()
{
$("#btn1").click(function () {
$('dd').toggleClass('invisible');
});
$('dt').click(function () {
$(this).css('background', 'yellow');
})
/**
*
* Open the file named jquery_faq.html for editing. Commit all changes to GitHub.
Under the FAQ, add 3 unordered lists like above.
Each list should contain a national park name in an h3 element, and a ul of 4 facts about the park.
Create a button that, when clicked, makes the last li in each ul have a yellow background.
**/
// The button btn2 was clicked
$('#btn2').click(function () {
// Travel thru the ul elements
$('ul').each(function (index, elem) {
// elem is a ul item
$(elem).children().last().css('background', 'yellow');
});
})
/**
When any h3 is clicked, the lis underneath it should be bolded. Use font-weight: bold to achieve this.
**/
$('h3').click(function () {
$(this).next().children().css('font-weight', 'bold')
})
/**
When any list item is clicked, first li of the parent ul should have a font color of blue.
**cs
*
**/
$('li').click(function () {
$(this).parent().children().first().css('color', 'blue');
})
/**
* At the top of the page, add a div with two elements, an h1 that reads "Would you like to sign up for our newsletter?" and a span that has an 'x' in it. When the 'x' is clicked, hide the entire div element.**/
$('#close').click(function () {
$(this).parent().css('display', 'none');
})
/**
The uls next to each h3 that contain facts about each park should start out hidden, and when the corresponding h3 is clicked, t
he display of the ul should be toggled with a sliding effect.**/
$('h3').click(function () {
$(this).next().slideToggle();
})
/**
After the user has been on the page for 8 seconds, an h2 should fade in that asks the user to register for the site.
**/
// $('#register').hide();
//
// setTimeout((function(){
// $('#register').fadeIn();
// }), 8000);
// $('#register').delay(8000).fadeIn();
// $('#overlay').modal('hide');
setTimeout(function() {
$('#overlay').modal('show');
}, 8000);
/**
As always, make sure you are adding, committing and pushing to GitHub.
Bonus
Use a bootstrap alert for the dismissible message that shows on page load.**/
/**
Use a bootstrap modal for the message that fades in after 8 seconds. You may find that you can use bootstrap's modal methods to achieve the fading effect.
*/
}
})();
</script>
</body>
</html>