FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lab6 created. jquery function added basic function all works · hannabeasiam/JavaScript_Study@06a4958 · GitHub

Commit 06a4958

Browse files
committed
lab6 created. jquery function added basic function all works
1 parent c09b1f7 commit 06a4958

4 files changed

Lines changed: 111 additions & 0 deletions

File tree

‎algorithm.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```
2+
Using jQuery, create a web page that contains a form and below the form a <div> containing a small image and text of your choice. In the form, create an Effect field that contains the following radio buttons: Show, Hide, Toggle, Fade In, Fade Out, Fade To, Slide Down, Slide Up, Slide Toggle. Add an Apply button to the form that when clicked, performs the selected jQuery animation on the <div> tag. E.g. If Show is selected, the <div> is shown or if Hide is selected, the <div> is hidden.
3+
```
4+
+ create form tag with 9 radio button
5+
- Show, Hide, Toggle, Fade In, Fade Out, Fade To, Slide Down, Slide Up, Slide Toggle. are button value
6+
- adjust above jquery actions with onclick event hander to div tag
7+
8+
+ below form tag create div tag with image with text
9+
10+
+ add text to discribe animation function
11+
12+
+ set original file opacity 1000 on reset button or add third parameter to come back original version

‎assets/css/style.css‎

Whitespace-only changes.

‎assets/img/logo.png‎

2.82 KB
LoadingViewer requires iframe.

‎index.html‎

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Lab6 Hanna Lee</title>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link href="assets/css/style.css" rel="stylesheet">
8+
<!--<script src="script/lab6.js"></script>-->
9+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
10+
<script type="text/javascript">
11+
jQuery(document).ready(function() { //open anonymous function
12+
//grab input tag add
13+
14+
$('input').on('change',function () {
15+
$(this).each(function() {
16+
var findID = this.id; console.log(findID);
17+
// Show, Hide, Toggle, Fade In, Fade Out, Fade To, Slide Down, Slide Up, Slide Toggle.
18+
switch (findID) {
19+
case 'Show':
20+
$('div').show();
21+
break;
22+
case 'Hide':
23+
$('div').hide();
24+
break;
25+
case 'Toggle':
26+
$('div').toggle();
27+
break;
28+
case 'FadeIn':
29+
$('div').fadeIn(); //Display the matched elements by fading them to opaque.
30+
break;
31+
case 'FadeOut':
32+
$('div').fadeOut(3000);//Hide the matched elements by fading them to transparent.
33+
break;
34+
case 'FadeTo': //slow indicate duration of 200-600 opacity 0.5
35+
$('div').fadeTo('slow', 0.5); //Adjust the opacity of the matched elements.
36+
break;
37+
case 'SlideDown':
38+
$('div').slideDown(); //Display the matched elements with a sliding motion.
39+
break;
40+
case 'SlideUp':
41+
$('div').slideUp(); //Hide the matched elements with a sliding motion.
42+
break;
43+
case 'SlideToggle':
44+
$('div').slideToggle(); //Display or hide the matched elements with a sliding motion.
45+
break;
46+
}
47+
});
48+
49+
});
50+
51+
52+
});
53+
54+
55+
</script>
56+
</head>
57+
<body>
58+
<h1>Explore jquery</h1>
59+
<form name="myForm">
60+
<p>select function</p>
61+
62+
<input type="radio" name="animation" id="Show">
63+
<label for="Show">Show</label>
64+
65+
<input type="radio" name="animation" id="Hide">
66+
<label for="Hide">Hide</label>
67+
68+
<input type="radio" name="animation" id="Toggle">
69+
<label for="Toggle">Toggle</label>
70+
71+
<input type="radio" name="animation" id="FadeIn">
72+
<label for="FadeIn">Fade In</label>
73+
74+
<input type="radio" name="animation" id="FadeOut">
75+
<label for="FadeOut">Fade Out</label>
76+
77+
<input type="radio" name="animation" id="FadeTo">
78+
<label for="FadeTo">Fade To</label>
79+
80+
<input type="radio" name="animation" id="SlideDown">
81+
<label for="SlideDown">Slide Down</label>
82+
83+
<input type="radio" name="animation" id="SlideUp">
84+
<label for="SlideUp">Slide Up</label>
85+
86+
<input type="radio" name="animation" id="SlideToggle">
87+
<label for="SlideToggle">Slide Toggle</label>
88+
</form>
89+
<div id="soflomain" >
90+
<img src="assets/img/logo.png" alt="sofloLogo">
91+
<p>Not only is technology always changing. It’s also important to remember that the internet has a numerous amount of recourses to learn from as a programmer.
92+
Being a part of the online community as programming students, and recent programming graduates; this is a platform where likeminded people share resources that helped them learn and grow.
93+
With a numerous amount of information shared on this one platform, as a one stop shop to find resources that you need; as a student programmer entering the world as a professional.
94+
At SoFlo Nucleus learning never ends.</p>
95+
</div>
96+
97+
98+
</body>
99+
</html>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL