├── README.md ├── Hands-on Project 4-1 ├── tuba2.png ├── tractor.htm ├── tuba.css ├── tubaie.css └── tuba.js ├── Hands-on Project 10-1 ├── Images │ ├── frog.jpg │ ├── frog_01.png │ ├── frog_02.png │ ├── frog_03.png │ ├── frog_04.png │ ├── frog_05.png │ ├── frog_06.png │ ├── frog_01_sm.png │ ├── frog_02_sm.png │ ├── frog_03_sm.png │ ├── frog_04_sm.png │ ├── frog_05_sm.png │ └── frog_06_sm.png ├── index.htm ├── script.js └── styles.css ├── Hands-on Project 12-1 ├── script.js ├── index.htm └── styles.css ├── Hands-on Project 12-2 ├── script.js ├── index.htm └── styles.css ├── Hands-on Project 9-2 ├── results.htm ├── script.js ├── index.htm └── styles.css ├── Hands-on Project 9-3 ├── results.htm ├── index.htm ├── script.js └── styles.css ├── Hands-on Project 5-2 ├── confirm.htm ├── index.htm └── styles.css ├── Hands-on Project 11-1 ├── search.htm ├── search.php ├── script.js ├── styles.css └── modernizr.custom.65897.js ├── Hands-on Project 5-1 └── index.htm ├── Hands-on Project 11-4 ├── address.htm ├── script.js ├── styles.css └── modernizr.custom.65897.js ├── Hands-on Project 1-1 ├── index.htm └── styles.css ├── Hands-on Project 6-1 ├── results.htm ├── index.htm ├── script.js ├── styles.css └── modernizr.custom.65897.js ├── Hands-on Project 6-2 ├── results.htm ├── index.htm ├── styles.css └── script.js ├── Hands-on Project 2-1 ├── index.htm └── styles.css ├── Hands-on Project 8-1 ├── script.js ├── index.htm └── styles.css ├── Hands-on Project 3-2 ├── index.htm └── styles.css ├── Hands-on Project 2-4 ├── styles.css └── index.htm ├── Hands-on Project 2-5 ├── styles.css └── index.htm ├── Hands-on Project 3-1 ├── index.htm └── styles.css ├── Hands-on Project 3-4 ├── index.htm └── styles.css ├── Hands-on Project 7-1 ├── index.htm └── styles.css ├── Hands-on Project 4-3 ├── index.htm └── styles.css ├── Hands-on Project 1-4 ├── index.htm └── styles.css ├── Hands-on Project 5-5 ├── styles.css └── index.htm ├── Hands-on Project 7-3 ├── styles.css └── index.htm ├── Hands-on Project 7-2 ├── index.htm └── styles.css └── Hands-on Project 1-3 ├── styles.css └── index.htm /README.md: -------------------------------------------------------------------------------- 1 | # JavaScript_6th_Edition_Hands-On_Projects -------------------------------------------------------------------------------- /Hands-on Project 4-1/tuba2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 4-1/tuba2.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog.jpg -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_01.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_02.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_03.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_04.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_05.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_06.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_01_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_01_sm.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_02_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_02_sm.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_03_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_03_sm.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_04_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_04_sm.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_05_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_05_sm.png -------------------------------------------------------------------------------- /Hands-on Project 10-1/Images/frog_06_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisakilker/JavaScript_6th_Edition_Hands-On_Projects/HEAD/Hands-on Project 10-1/Images/frog_06_sm.png -------------------------------------------------------------------------------- /Hands-on Project 12-1/script.js: -------------------------------------------------------------------------------- 1 | //Lisa Kilker 2 | //May 9, 2018 3 | //Chapter 12 4 | //Hands-on Project 12-1 5 | 6 | function display(event) { 7 | $(event.currentTarget).next().fadeIn("slow"); 8 | } 9 | 10 | $("h3").click(display); -------------------------------------------------------------------------------- /Hands-on Project 12-2/script.js: -------------------------------------------------------------------------------- 1 | //Lisa Kilker 2 | //May 9, 2018 3 | //Chapter 12 4 | //Hands-on Project 12-2 5 | 6 | function convert() { 7 | var lb = $("#pValue").val(); 8 | var kg = Math.round(lb/2.2); 9 | 10 | $("#kValue").html(kg); 11 | } 12 | 13 | $("#convertButton").click(convert); 14 | ("#pValue").val(""); 15 | ("#kValue").html(""); -------------------------------------------------------------------------------- /Hands-on Project 9-2/results.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 9-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 9-2 25 |

26 |
27 | 28 |
29 |

Login successful

30 |
31 | 32 | -------------------------------------------------------------------------------- /Hands-on Project 9-3/results.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 9-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 9-2 25 |

26 |
27 | 28 |
29 |

Login successful

30 |
31 | 32 | -------------------------------------------------------------------------------- /Hands-on Project 5-2/confirm.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Confirmation 17 | 32 | 33 | 34 | 35 |

Your address has been updated.

36 | 37 | 38 | -------------------------------------------------------------------------------- /Hands-on Project 11-1/search.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 11-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 11-1 25 |

26 |
27 | 28 |
29 |
30 |
31 | 32 | 33 |
34 |

Powered byBing

35 |
36 |
37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Hands-on Project 5-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 5-1 17 | 18 | 19 | 20 |

21 | Hands-on Project 5-1 22 |

23 | 24 |

25 |

26 |

27 |

28 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Hands-on Project 11-4/address.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 11-4 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 11-4 25 |

26 |
27 | 28 |
29 |

Address

30 |
31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 |
42 |
43 |
44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Hands-on Project 1-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 1-1 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |

25 | Hands-on Project 1-1 26 |

27 |
28 | 29 |
30 |

Financial Planning Tips

31 | 32 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /Hands-on Project 9-2/script.js: -------------------------------------------------------------------------------- 1 | //JavaScript file 2 | //Hands-on Project 9-2 3 | //Lisa Kilker 4 | //May 2, 2018 5 | 6 | "use strict"; 7 | 8 | function populateInfo() { 9 | if (document.cookie) { 10 | var uname = document.cookie; 11 | uname = uname.substring(uname.lastIndexOf("=") + 1); 12 | document.getElementById("usernameinput").value = uname; 13 | } 14 | } 15 | 16 | function processCookie() { 17 | document.cookie = "username=" + document.getElementById("usernameinput").value; 18 | } 19 | 20 | function handleSubmit(evt) { 21 | if (evt.preventDefault) { 22 | evt.preventDefault(); 23 | 24 | } else { 25 | evt.returnValue = false; 26 | } 27 | 28 | processCookie(); 29 | 30 | document.getElementsByTagName("form")[0].submit(); 31 | } 32 | 33 | function createEventListener() { 34 | var loginForm = document.getElementsByTagName("form")[0]; 35 | 36 | if (loginForm.addEventListener) { 37 | loginForm.addEventListener("submit", handleSubmit, false); 38 | 39 | } else if (loginForm.attachEvent) { 40 | loginForm.attachEvent("onsubmit", handleSubmit); 41 | } 42 | } 43 | 44 | function setUpPage() { 45 | populateInfo(); 46 | createEventListener(); 47 | } 48 | 49 | if (window.addEventListener) { 50 | window.addEventListener("load", setUpPage, false); 51 | 52 | } else if (window.attachEvent) { 53 | window.attachEvent("onload", setUpPage); 54 | } -------------------------------------------------------------------------------- /Hands-on Project 12-2/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 12-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 12-2 25 |

26 |
27 | 28 |
29 |

Pounds (lb) to Kilograms (Kg) converter

30 |
31 |
32 | 35 | 36 |
37 |
38 | 39 |
40 |
41 |

Weight in kilograms

42 |

43 |
44 |
45 |
46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Hands-on Project 11-1/search.php: -------------------------------------------------------------------------------- 1 | array( 34 | 35 | 'request_fulluri' => true, 36 | 37 | // ignore_errors can help debug – remove for production. This option added in PHP 5.2.10 38 | 39 | 'ignore_errors' => true, 40 | 41 | 'header' => "Authorization: Basic $auth") 42 | 43 | ); 44 | 45 | $context = stream_context_create($data); 46 | 47 | // Get the response from Bing. 48 | 49 | $response = file_get_contents($requestUri, 0, $context); 50 | 51 | header("Content-Type: text/json"); 52 | 53 | echo $response; 54 | 55 | ?> -------------------------------------------------------------------------------- /Hands-on Project 6-1/results.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 6-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 6-1 25 |

26 |
27 | 28 |
29 |

Your form has been submitted

30 |
31 |

You entered the following data:

32 | 33 | 45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /Hands-on Project 6-2/results.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 6-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 6-1 25 |

26 |
27 | 28 |
29 |

Your form has been submitted

30 |
31 |

You entered the following data:

32 | 33 | 45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /Hands-on Project 9-2/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 9-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 9-2 25 |

26 |
27 | 28 |
29 |
30 |
31 |
32 | Site Login 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Hands-on Project 9-3/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 9-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 9-2 25 |

26 |
27 | 28 |
29 |
30 |
31 |
32 | Site Login 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Hands-on Project 10-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 10-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 10-1 25 |

26 |
27 | 28 |
29 |

Drag the tiles to form the picture

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 | -------------------------------------------------------------------------------- /Hands-on Project 2-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 2-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 2-1 25 |

26 |
27 | 28 |
29 |

Fahrenheit (° F) to Celsius (° C) converter

30 |
31 |
32 | 35 | 36 |
37 |
38 | 39 |
40 |
41 |

Temp in ° C

42 |

 

43 |
44 |
45 |
46 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Hands-on Project 9-3/script.js: -------------------------------------------------------------------------------- 1 | //JavaScript file 2 | //Hands-on Project 9-3 3 | //Lisa Kilker 4 | //May 2, 2018 5 | 6 | "use strict"; 7 | 8 | function populateInfo() { 9 | if (document.cookie) { 10 | var uname = document.cookie; 11 | uname = uname.substring(uname.lastIndexOf("=") + 1); 12 | document.getElementById("usernameinput").value = uname; 13 | } 14 | } 15 | 16 | function processCookie() { 17 | if (document.getElementById("rememberinput").checked) { 18 | document.cookie = "username=" + document.getElementById("usernameinput").value; 19 | 20 | } else { 21 | 22 | var expiresDate = new Date(); 23 | expiresDate.setDate(expiresDate.getDate() - 7); 24 | document.cookie = "username=null; expires=" + expiresDate.toUTCString(); 25 | } 26 | } 27 | 28 | function handleSubmit(evt) { 29 | if (evt.preventDefault) { 30 | evt.preventDefault(); 31 | 32 | } else { 33 | evt.returnValue = false; 34 | } 35 | 36 | processCookie(); 37 | 38 | document.getElementsByTagName("form")[0].submit(); 39 | } 40 | 41 | function createEventListener() { 42 | var loginForm = document.getElementsByTagName("form")[0]; 43 | 44 | if (loginForm.addEventListener) { 45 | loginForm.addEventListener("submit", handleSubmit, false); 46 | 47 | } else if (loginForm.attachEvent) { 48 | loginForm.attachEvent("onsubmit", handleSubmit); 49 | } 50 | } 51 | 52 | function setUpPage() { 53 | populateInfo(); 54 | createEventListener(); 55 | } 56 | 57 | if (window.addEventListener) { 58 | window.addEventListener("load", setUpPage, false); 59 | 60 | } else if (window.attachEvent) { 61 | window.attachEvent("onload", setUpPage); 62 | } -------------------------------------------------------------------------------- /Hands-on Project 8-1/script.js: -------------------------------------------------------------------------------- 1 | //Hands-on Project 8-1 2 | //Author: Lisa Kilker 3 | //Date: April 25, 2018 4 | 5 | "use strict"; 6 | 7 | var newAccountArray = []; 8 | 9 | function createID() { 10 | var fname = document.getElementById("fnameinput"); 11 | var lname = document.getElementById("lnameinput"); 12 | var zip = document.getElementById("zipinput"); 13 | var account = document.getElementById("accountidbox"); 14 | var fields = document.getElementsByTagName("input"); 15 | var acctid; 16 | var firstInit; 17 | var lastInit; 18 | 19 | if (fname != null && lname != null && zip != null 20 | && fname != "" && lname != "" && zip != "") { 21 | 22 | firstInit = fname.value.charAt(0).toUpperCase(); 23 | lastInit = lname.value.charAt(0).toUpperCase(); 24 | acctid = firstInit + lastInit + zip.value; 25 | account.value = acctid; 26 | newAccountArray = []; 27 | 28 | 29 | for (var i = 0; i < fields.length - 1; i++) { 30 | newAccountArray.push(fields[i].value); 31 | } 32 | } 33 | } 34 | 35 | function createEventListeners () { 36 | var fname = document.getElementById("fnameinput"); 37 | var lname = document.getElementById("lnameinput"); 38 | var zip = document.getElementById("zipinput"); 39 | 40 | if (fname.addEventListener) { 41 | fname.addEventListener("change", createID, false); 42 | lname.addEventListener("change", createID, false); 43 | zip.addEventListener("change", createID, false); 44 | 45 | } else if (fname.attachEvent) { 46 | fname.attachEvent("onchange", createID); 47 | lname.attachEvent("onchange", createID); 48 | zip.attachEvent("onchange", createID); 49 | } 50 | } 51 | 52 | if (window.addEventListener) { 53 | window.addEventListener("load", createEventListeners, false); 54 | 55 | } else if (window.attachEvent) { 56 | window.attachEvent("onload", createEventListeners); 57 | } 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Hands-on Project 8-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 8-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 8-1 25 |

26 |
27 | 28 |
29 |

New Account Information

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 | -------------------------------------------------------------------------------- /Hands-on Project 12-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 12-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 12-1 25 |

26 |
27 | 28 |
29 |

Brownies

30 |

Ingredients

31 | 41 |

Instructions

42 |
43 |

Preheat oven to 325.

44 |

Melt together butter and dark chocolate. Allow to cool to room temperature.

45 |

Mix in salt, vanilla, and sugar.

46 |

Stir in eggs, one at a time.

47 |

Add flour, then stir until almost combined.

48 |

Add walnuts (if using), then stir once or twice.

49 |

Butter and flour an 8 x 8 glass baking dish, then pour batter into dish and jiggle gently to distribute to corners.

50 |

Bake on center rack for 35 minutes, or until a toothpick or sharp knife comes out sticky, with just a few crumbs but not wet.

51 |
52 |
53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Hands-on Project 3-2/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 3-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 3-2 25 |

26 |
27 | 28 |
29 |

Contact Information

30 |
31 |
32 | 36 | 40 | 44 |
45 |
46 | 47 |
48 |
49 |
50 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Hands-on Project 2-4/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 2 3 | Hands-on Project 2-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Verdana, Geneva, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #330570; 58 | width: 100%; 59 | color: #FFFFFF; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | } 64 | 65 | /* main content */ 66 | article { 67 | width: 960px; 68 | height: 250px; 69 | text-align: left; 70 | background: #FFCF40; 71 | } 72 | 73 | article h2 { 74 | font-weight: bold; 75 | font-size: 24px; 76 | padding: 10px; 77 | } 78 | 79 | /* form */ 80 | form { 81 | margin: 0 auto; 82 | } 83 | 84 | input { 85 | float: left; 86 | clear: left; 87 | margin: 10px; 88 | } 89 | 90 | label { 91 | float: left; 92 | font-size: 1.4em; 93 | } 94 | -------------------------------------------------------------------------------- /Hands-on Project 2-5/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 2 3 | Hands-on Project 2-5 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Verdana, Geneva, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #330570; 58 | width: 100%; 59 | color: #FFFFFF; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | } 64 | 65 | /* main content */ 66 | article { 67 | width: 960px; 68 | height: 250px; 69 | text-align: left; 70 | background: #FFCF40; 71 | } 72 | 73 | article h2 { 74 | font-weight: bold; 75 | font-size: 24px; 76 | padding: 10px; 77 | } 78 | 79 | /* form */ 80 | form { 81 | margin: 0 auto; 82 | } 83 | 84 | input { 85 | float: left; 86 | clear: left; 87 | margin: 10px; 88 | } 89 | 90 | label { 91 | float: left; 92 | font-size: 1.4em; 93 | } 94 | -------------------------------------------------------------------------------- /Hands-on Project 11-1/script.js: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 11 3 | Hands-on Project 11-1 4 | 5 | Author: Lisa Kilker 6 | Date: May 9, 2018 7 | 8 | Filename: script.js 9 | */ 10 | 11 | "use strict"; 12 | 13 | var httpRequest = false; 14 | 15 | function getRequestObject() { 16 | try { 17 | httpRequest = new XMLHttpRequest(); 18 | } 19 | catch (requestError) { 20 | return false; 21 | } 22 | return httpRequest; 23 | } 24 | 25 | function getResults(evt) { 26 | if (evt.preventDefault) { 27 | evt.preventDefault(); 28 | } else { 29 | evt.returnValue = false; 30 | } 31 | 32 | var entry = document.getElementsByTagName("input")[0].value; 33 | 34 | if (!httpRequest) { 35 | httpRequest = getRequestObject(); 36 | } 37 | 38 | httpRequest.abort(); 39 | httpRequest.open("get","search.php?q=" + entry, true); 40 | httpRequest.send(); 41 | httpRequest.onreadystatechange = displaySuggestions; 42 | } 43 | 44 | function displaySuggestions() { 45 | if (httpRequest.readyState === 4 && httpRequest.status === 200) { 46 | searchResults = JSON.parse(httpRequest.responseText); 47 | 48 | var items = searchResults.d.results; 49 | var articleEl = document.getElementsByTagName("article")[0]; 50 | 51 | for (var i = 0; i < items.length; i++) { 52 | var newDiv = document.createElement("div"); 53 | var head = document.createDocumentFragment(); 54 | var newP1 = document.createElement("p"); 55 | var newP2 = document.createElement("p"); 56 | var newP3 = document.createElement("p"); 57 | var newA = document.createElement("a"); 58 | 59 | head.appendChild(newP1); 60 | newA.innerHTML = items[i].Title; 61 | newA.setAttribute("href", items[i].Url); 62 | newP1.appendChild(newA); 63 | newP2.className = "url"; 64 | newP3.innerHTML = items[i].Description; 65 | newDiv.appendChild(head); 66 | newDiv.appendChild(newP2); 67 | newDiv.appendChild(newP3); 68 | articleEl.appendChild(newDiv); 69 | } 70 | } 71 | } 72 | 73 | var form = document.getElementsByTagName("form")[0]; 74 | if (form.addEventListener) { 75 | form.addEventListener("submit", getResults, false); 76 | } else if (form.attachEvent) { 77 | form.attachEvent("onsubmit", getResults); 78 | } 79 | 80 | -------------------------------------------------------------------------------- /Hands-on Project 11-4/script.js: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 11 3 | Hands-on Project 11-4 4 | 5 | Author: Lisa Kilker 6 | Date: May 9, 2018 7 | 8 | Filename: script.js 9 | */ 10 | 11 | "use strict"; 12 | 13 | var httpRequest = false; 14 | 15 | function getRequestObject() { 16 | 17 | try { 18 | httpRequest = new XMLHttpRequest(); 19 | } 20 | catch (requestError) { //display city and state fields and labels for manual input 21 | document.getElementById("csset").style.visibility = "visible"; //remove event listeners so additional input is ignored 22 | var zip = document.getElementById("zip").value; 23 | 24 | if (zip.addEventListener) { 25 | zip.removeEventListener("keyup", checkInput, false); 26 | } else if (zip.attachEvent) { 27 | zip.detachEvent("onkeyup", checkInput); 28 | } 29 | return false; 30 | } 31 | return httpRequest; 32 | } 33 | 34 | function checkInput() { 35 | var zip = document.getElementById("zip").value; 36 | if (zip.length === 5) { 37 | getLocation(); 38 | } else { 39 | document.getElementById("city").value = ""; 40 | document.getElementById("state").value = ""; 41 | } 42 | } 43 | 44 | function getLocation() { 45 | var zip = document.getElementById("zip").value; 46 | if (!httpRequest) { 47 | httpRequest = getRequestObject(); 48 | } 49 | 50 | httpRequest.abort(); 51 | httpRequest.open("get","http://api.zippopotam.us/us/" + zip, true); 52 | httpRequest.send(); 53 | httpRequest.onreadystatechange = displayData; 54 | } 55 | 56 | function displayData() { 57 | if(httpRequest.readyState === 4 && httpRequest.status === 200) { 58 | 59 | var resultData = JSON.parse(httpRequest.responseText); 60 | var city = document.getElementById("city"); 61 | var state = document.getElementById("state"); 62 | 63 | city.value = resultData.places[0]["place name"]; 64 | state.value = resultData.places[0]["state abbreviation"]; 65 | 66 | document.getElementById("zip").blur(); 67 | document.getElementById("csset").style.visibility = "visible"; 68 | 69 | } 70 | } 71 | 72 | var zip = document.getElementById("zip"); 73 | if (zip.addEventListener) { 74 | zip.addEventListener("keyup", checkInput, false); 75 | } else if (zip.attachEvent) { 76 | zip.attachEvent("onkeyup", checkInput); 77 | } 78 | 79 | -------------------------------------------------------------------------------- /Hands-on Project 3-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 3-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 3-1 25 |

26 |
27 | 28 |
29 |

Lunch selections

30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 |

45 |
46 |
47 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Hands-on Project 3-4/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 3-4 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 3-4 25 |

26 |
27 | 28 |
29 |
30 | 37 |

38 |
39 |
40 |
41 | 44 | 45 |
46 |
47 | 48 |
49 |
50 |
51 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Hands-on Project 3-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 3 3 | Hands-on Project 3-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Verdana, Geneva, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #5472B2; 58 | width: 100%; 59 | color: #FFFFFF; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | } 64 | 65 | /* main content */ 66 | article { 67 | width: 960px; 68 | height: 250px; 69 | text-align: left; 70 | background: #FFDB70; 71 | } 72 | 73 | article h2 { 74 | font-weight: bold; 75 | font-size: 24px; 76 | padding: 10px; 77 | } 78 | 79 | /* form */ 80 | form { 81 | float: left; 82 | } 83 | 84 | input { 85 | float: left; 86 | clear: left; 87 | margin: 10px; 88 | } 89 | 90 | label { 91 | float: left; 92 | font-size: 1.4em; 93 | } 94 | 95 | /* total div */ 96 | article div { 97 | width: 50%; 98 | float: right; 99 | font-size: 18px; 100 | font-weight: bold; 101 | } 102 | -------------------------------------------------------------------------------- /Hands-on Project 1-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 1 3 | Hands-on Project 1-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Verdana, Geneva, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #330570; 58 | width: 100%; 59 | color: #FFFFFF; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | -webkit-border-top-right-radius: 20px; 64 | -webkit-border-top-left-radius: 20px; 65 | -moz-border-radius-topright: 20px; 66 | -moz-border-radius-topleft: 20px; 67 | border-top-right-radius: 20px; 68 | border-top-left-radius: 20px; 69 | } 70 | 71 | /* main content */ 72 | article { 73 | width: 960px; 74 | text-align: left; 75 | background: #FFCF40; 76 | -webkit-border-bottom-right-radius: 20px; 77 | -moz-border-radius-bottomright: 20px; 78 | border-bottom-right-radius: 20px; 79 | } 80 | 81 | article h2 { 82 | font-weight: bold; 83 | font-size: 24px; 84 | padding: 10px; 85 | } 86 | 87 | article ol li { 88 | padding: 10px; 89 | margin-left: 35px; 90 | list-style-type: decimal; 91 | } 92 | -------------------------------------------------------------------------------- /Hands-on Project 2-4/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 2-4 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 2-4 25 |

26 |
27 | 28 |
29 |

Lunch selections

30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Hands-on Project 7-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 7-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 7-1 25 |

26 |
27 | 28 |
29 |

Square Root Calculator

30 |
31 |
32 | 35 | 36 |
37 |
38 | 39 |
40 |
41 |

Square root

42 |

43 |
44 |
45 |
46 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Hands-on Project 4-3/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 4-3 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 4-3 25 |

26 |
27 | 28 |
29 |
30 |

31 | 38 |
39 |
40 |
41 | 44 | 45 |
46 |
47 | 48 |
49 |
50 |
51 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /Hands-on Project 2-5/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 2-5 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 2-5 25 |

26 |
27 | 28 |
29 |

Lunch selections

30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Hands-on Project 1-4/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 1-4 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 1-4 25 |

26 |
27 | 28 |
29 |

Shipping Address

30 |
31 |
32 | Choose an address 33 | 39 | 45 |
46 |
47 | 51 | 55 | 59 | 63 |
64 |
65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /Hands-on Project 6-1/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 6-1 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 6-1 25 |

26 |
27 | 28 |
29 |

Personal Information

30 |
31 |
32 |
33 |
34 | 37 | 38 | 41 | 42 | 45 | 46 | 49 | 50 | 53 | 54 | 57 | 58 | 61 | 62 |
63 |
64 | 65 |
66 |
67 | 68 |
69 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Hands-on Project 6-2/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 6-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 6-2 25 |

26 |
27 | 28 |
29 |

Personal Information

30 |
31 |
32 |
33 |
34 | 37 | 38 | 41 | 42 | 45 | 46 | 49 | 50 | 53 | 54 | 57 | 58 | 61 | 62 |
63 |
64 | 65 |
66 |
67 | 68 |
69 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Hands-on Project 5-5/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 5 3 | Hands-on Project 5-5 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #04819E; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | width: 960px; 78 | text-align: left; 79 | background: ivory; 80 | padding: 20px; 81 | } 82 | 83 | h2 { 84 | font-weight: bold; 85 | font-size: 24px; 86 | } 87 | 88 | h3 { 89 | font-weight: bold; 90 | font-size: 18px; 91 | margin: 20px 0 10px 0; 92 | } 93 | 94 | li { 95 | margin-left: 30px; 96 | } 97 | -------------------------------------------------------------------------------- /Hands-on Project 7-3/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 7 3 | Hands-on Project 7-3 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | width: 640px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Verdana, Geneva, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #5472B2; 58 | width: 100%; 59 | color: #FFFFFF; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | } 64 | 65 | /* main content */ 66 | article { 67 | width: 640px; 68 | text-align: left; 69 | background: #FFDB70; 70 | overflow: auto; 71 | } 72 | 73 | article h2 { 74 | font-weight: bold; 75 | font-size: 24px; 76 | padding: 10px; 77 | } 78 | 79 | /* form */ 80 | form { 81 | float: left; 82 | } 83 | 84 | input { 85 | float: left; 86 | clear: left; 87 | margin: 10px; 88 | } 89 | 90 | label, #sButton { 91 | float: left; 92 | font-size: 1.4em; 93 | } 94 | 95 | /* total div */ 96 | table { 97 | float: right; 98 | font-size: 18px; 99 | text-align: right; 100 | margin-right: 25px; 101 | } 102 | 103 | table td { 104 | padding: 5px 0; 105 | } 106 | 107 | col.label { 108 | width: 175px; 109 | } 110 | 111 | col.amount { 112 | width: 100px; 113 | } 114 | 115 | table tr:last-of-type { 116 | font-weight: bold; 117 | } 118 | -------------------------------------------------------------------------------- /Hands-on Project 5-2/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 5-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 5-2 25 |

26 |
27 | 28 |
29 |

Change of address form

30 |
31 |
32 | 35 | 36 | 39 | 40 | 43 | 44 | 47 | 48 |
49 |
50 | 51 |
52 |
53 | 54 |
55 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Hands-on Project 7-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 7 3 | Hands-on Project 7-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 600px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFC340; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | } 64 | 65 | /* main content */ 66 | article { 67 | text-align: center; 68 | background: white; 69 | } 70 | 71 | article h2 { 72 | font-weight: bold; 73 | font-size: 24px; 74 | padding: 10px; 75 | } 76 | 77 | /* form */ 78 | fieldset { 79 | padding: 1em; 80 | background: #FFAE00; 81 | border: none; 82 | float: left; 83 | width: 33.3334%; 84 | height: 100px; 85 | } 86 | input { 87 | font-size: 1.1em; 88 | width: 4em; 89 | clear: left; 90 | font-family: Arial, Helvetica, sans-serif; 91 | text-align: center; 92 | } 93 | input:focus { 94 | background: #e3d5ba; 95 | } 96 | label { 97 | display: block; 98 | } 99 | input, label, button, form p { 100 | margin: 5px 10px; 101 | } 102 | p { 103 | clear: left; 104 | } 105 | #sqRoot { 106 | width: 4em; 107 | font-size: 1.1em; 108 | height: 1.6em; 109 | background: white; 110 | padding: 0.2em; 111 | margin: 10px auto; 112 | border: 1px solid rgb(164,164,164); 113 | } 114 | -------------------------------------------------------------------------------- /Hands-on Project 12-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 12 3 | Hands-on Project 12-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 640px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #04819E; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | width: 640px; 78 | text-align: left; 79 | background: ivory; 80 | padding: 20px; 81 | } 82 | 83 | h2 { 84 | font-weight: bold; 85 | font-size: 24px; 86 | } 87 | 88 | h3 { 89 | font-weight: bold; 90 | font-size: 18px; 91 | margin: 20px 0 10px 0; 92 | font-family: "times new roman", times, serif; 93 | } 94 | 95 | li, p { 96 | margin-bottom: 0.5em; 97 | } 98 | 99 | .ingr, .instr { 100 | display: none; 101 | } 102 | -------------------------------------------------------------------------------- /Hands-on Project 12-2/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 12 3 | Hands-on Project 12-2 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 600px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFC340; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | text-align: center; 71 | background: white; 72 | border-bottom: 1px solid black; 73 | border-left: 1px solid black; 74 | border-right: 1px solid black; 75 | } 76 | 77 | article h2 { 78 | font-weight: bold; 79 | font-size: 24px; 80 | padding: 10px; 81 | } 82 | 83 | /* form */ 84 | form { 85 | background: #A67100; 86 | padding: 5px; 87 | height: 110px; 88 | } 89 | fieldset { 90 | padding: 1em 0.5em; 91 | background: #FFAE00; 92 | border: none; 93 | float: left; 94 | width: 33.3334%; 95 | height: 100px; 96 | } 97 | input { 98 | font-size: 1em; 99 | width: 4em; 100 | clear: left; 101 | } 102 | input:focus { 103 | background: #e3d5ba; 104 | } 105 | label { 106 | display: block; 107 | } 108 | input, label, button, form p { 109 | margin: 5px; 110 | } 111 | p { 112 | clear: left; 113 | } 114 | p#kValue { 115 | width: 4em; 116 | font-size: 1.1em; 117 | height: 1.4em; 118 | background: white; 119 | padding: 0.2em; 120 | margin: 0 auto; 121 | } 122 | -------------------------------------------------------------------------------- /Hands-on Project 5-2/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 5 3 | Hands-on Project 5-2 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFE373; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | width: 960px; 71 | text-align: center; 72 | background: #BFA230; 73 | padding-bottom: 20px; 74 | border-bottom: 1px solid black; 75 | border-left: 1px solid black; 76 | border-right: 1px solid black; 77 | } 78 | 79 | article h2 { 80 | font-weight: bold; 81 | font-size: 24px; 82 | padding: 10px; 83 | } 84 | 85 | /* form */ 86 | 87 | fieldset { 88 | padding: 1em; 89 | background: white; 90 | text-align: right; 91 | } 92 | 93 | form { 94 | background: white; 95 | padding: 10px 5px 7px 5px; 96 | margin: 0 auto; 97 | width: 30em; 98 | border: 2px solid black; 99 | } 100 | 101 | input { 102 | font-size: 1em; 103 | float: left; 104 | } 105 | 106 | input:focus { 107 | background: #e3d5ba; 108 | } 109 | 110 | label { 111 | display: block; 112 | margin: 0.5em 1em 0 0; 113 | float: left; 114 | clear: left; 115 | width: 10em; 116 | } 117 | 118 | #submitsection { 119 | padding: 0.5em 0; 120 | text-align: center; 121 | } 122 | 123 | #submit { 124 | float: none; 125 | } -------------------------------------------------------------------------------- /Hands-on Project 2-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 2 3 | Hands-on Project 2-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 600px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFC340; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | text-align: center; 71 | background: white; 72 | border-bottom: 1px solid black; 73 | border-left: 1px solid black; 74 | border-right: 1px solid black; 75 | } 76 | 77 | article h2 { 78 | font-weight: bold; 79 | font-size: 24px; 80 | padding: 10px; 81 | } 82 | 83 | /* form */ 84 | form { 85 | background: #A67100; 86 | padding: 5px; 87 | height: 110px; 88 | } 89 | fieldset { 90 | padding: 1em; 91 | background: #FFAE00; 92 | border: none; 93 | float: left; 94 | width: 33.3334%; 95 | height: 100px; 96 | } 97 | input { 98 | font-size: 1em; 99 | width: 4em; 100 | clear: left; 101 | } 102 | input:focus { 103 | background: #e3d5ba; 104 | } 105 | label { 106 | display: block; 107 | } 108 | input, label, button, form p { 109 | float: left; 110 | margin: 5px 10px; 111 | } 112 | p { 113 | clear: left; 114 | } 115 | p#cValue { 116 | width: 4em; 117 | font-size: 1.1em; 118 | height: 1.4em; 119 | background: white; 120 | padding: 0.2em; 121 | overflow: hidden; 122 | text-overflow: ellipsis; 123 | } 124 | -------------------------------------------------------------------------------- /Hands-on Project 10-1/script.js: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 10 3 | Hands-on Project 10-1 4 | 5 | Author: Lisa Kilker 6 | Date: May 2, 2018 7 | 8 | Filename: script.js 9 | */ 10 | 11 | "use strict"; 12 | 13 | // global variables 14 | var loc = []; 15 | var origin; 16 | var onTop; 17 | 18 | // perform setup tasks when page first loads 19 | function setUpPage() { 20 | var puzzlePieces = document.querySelectorAll("#pieces div"); 21 | onTop = puzzlePieces.length + 1; 22 | for (var i = 0; i < puzzlePieces.length; i++) { 23 | if (puzzlePieces[i].addEventListener) { 24 | puzzlePieces[i].addEventListener("mousedown", startDrag, false); 25 | puzzlePieces[i].addEventListener("touchstart", startDrag, false); 26 | } else if (puzzlePieces[i].attachEvent) { 27 | puzzlePieces[i].attachEvent("onmousedown", startDrag); 28 | } 29 | } 30 | } 31 | 32 | // add event listeners and move object when user starts dragging 33 | function startDrag(event) { 34 | this.style.zIndex = onTop; // set z-index to move selected element on top of other elements 35 | onTop++; // increment z-index counter so next selected element is on top of other elements 36 | event.preventDefault(); 37 | 38 | if (event.type !== "mousedown") { 39 | this.addEventListener("touchmove", moveDrag, false); 40 | this.addEventListener("touchend", removeTouchListener, false); 41 | 42 | } else { 43 | this.addEventListener("mousemove", moveDrag, false); 44 | this.addEventListener("mouseup", removeDragListener, false); 45 | } 46 | loc = [this.offsetLeft,this.offsetTop]; 47 | origin = getCoords(event); 48 | } 49 | 50 | // calculate new location of dragged object 51 | function moveDrag(event) { 52 | var currentPos = getCoords(event); 53 | var deltaX = currentPos[0] - origin[0]; 54 | var deltaY = currentPos[1] - origin[1]; 55 | this.style.left = (loc[0] + deltaX) + "px"; 56 | this.style.top = (loc[1] + deltaY) + "px"; 57 | } 58 | 59 | // identify location of event 60 | function getCoords(event) { 61 | var coords = []; 62 | 63 | if (event.targetTouches && event.targetTouches.length) { 64 | var thisTouch = event.targetTouches[0]; 65 | coords[0] = thisTouch.clientX; 66 | coords[1] = thisTouch.clientY; 67 | 68 | } else { 69 | coords[0] = event.clientX; 70 | coords[1] = event.clientY; 71 | } 72 | return coords; 73 | } 74 | 75 | // remove mouse event listeners when dragging ends 76 | function removeDragListener() { 77 | this.removeEventListener("mousemove", moveDrag, false); 78 | this.removeEventListener("mouseup", removeDragListener, false); 79 | } 80 | 81 | function removeTouchListener() { 82 | this.removeEventListener("touchmove", moveDrag, false); 83 | this.removeEventListener("touchend", removeTouchListener, false); 84 | } 85 | 86 | // run setUpPage() function when page finishes loading 87 | if (window.addEventListener) { 88 | window.addEventListener("load", setUpPage, false); 89 | } -------------------------------------------------------------------------------- /Hands-on Project 11-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 6 3 | Hands-on Project 6-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 640px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #04819E; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | text-align: left; 78 | background: white; 79 | padding: 20px; 80 | } 81 | 82 | 83 | article div { 84 | margin: 0.8em 0; 85 | } 86 | 87 | article div p.head { 88 | font-weight: bold; 89 | font-size: 1.2em; 90 | } 91 | 92 | article div p.url { 93 | font-size: 0.8em; 94 | margin: 0.4em; 95 | color: #009030; 96 | } 97 | 98 | /* form */ 99 | form { 100 | text-align: center; 101 | padding: 2em; 102 | background: ivory; 103 | border: 1px solid black; 104 | position: relative; 105 | } 106 | 107 | input { 108 | font-size: 1em; 109 | } 110 | 111 | form p.credit { 112 | position: absolute; 113 | bottom: 5px; 114 | right: 5px; 115 | font-size: 0.8em; 116 | } 117 | 118 | /* list */ 119 | -------------------------------------------------------------------------------- /Hands-on Project 4-3/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 3 3 | Hands-on Project 3-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | width: 600px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFC340; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | text-align: center; 71 | background: white; 72 | border-bottom: 1px solid black; 73 | border-left: 1px solid black; 74 | border-right: 1px solid black; 75 | } 76 | 77 | article h2 { 78 | font-weight: bold; 79 | font-size: 24px; 80 | padding: 10px; 81 | } 82 | 83 | div { 84 | padding: 1em; 85 | border: none; 86 | height: 150px; 87 | float: right; 88 | width: 180px; 89 | text-align: left; 90 | } 91 | 92 | div p { 93 | font-weight: bold; 94 | margin-bottom: 0.4em; 95 | } 96 | 97 | li { 98 | margin-left: 1em; 99 | } 100 | 101 | /* form */ 102 | form { 103 | background: white; 104 | padding: 5px; 105 | height: 150px; 106 | width: 400px; 107 | 108 | } 109 | fieldset { 110 | padding: 1em; 111 | border: none; 112 | float: left; 113 | width: 190px; 114 | height: 150px; 115 | } 116 | 117 | input { 118 | font-size: 1em; 119 | width: 9em; 120 | clear: left; 121 | margin: 0 auto; 122 | } 123 | 124 | input:focus { 125 | background: #e3d5ba; 126 | } 127 | 128 | label { 129 | display: block; 130 | font-weight: bold; 131 | text-align: left; 132 | } 133 | 134 | input, label, button { 135 | margin: 5px 10px; 136 | } 137 | -------------------------------------------------------------------------------- /Hands-on Project 7-2/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 7-2 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 7-2 25 |

26 |
27 | 28 |
29 |

Day of the Week Lookup

30 |
31 |
32 | 35 | 36 |
37 |
38 | 39 |
40 |
41 |

Day of the Week

42 |

43 |
44 |
45 |
46 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Hands-on Project 3-4/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 3 3 | Hands-on Project 3-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | width: 600px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFC340; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | text-align: center; 71 | background: white; 72 | border-bottom: 1px solid black; 73 | border-left: 1px solid black; 74 | border-right: 1px solid black; 75 | } 76 | 77 | article h2 { 78 | font-weight: bold; 79 | font-size: 24px; 80 | padding: 10px; 81 | } 82 | 83 | div { 84 | padding: 1em; 85 | border: none; 86 | height: 150px; 87 | float: right; 88 | width: 180px; 89 | text-align: left; 90 | } 91 | 92 | div p { 93 | font-weight: bold; 94 | margin-top: 0.4em; 95 | } 96 | 97 | li { 98 | margin-left: 1em; 99 | list-style-type: disc; 100 | } 101 | 102 | /* form */ 103 | form { 104 | background: white; 105 | padding: 5px; 106 | height: 150px; 107 | width: 400px; 108 | 109 | } 110 | fieldset { 111 | padding: 1em; 112 | border: none; 113 | float: left; 114 | width: 190px; 115 | height: 150px; 116 | } 117 | 118 | input { 119 | font-size: 1em; 120 | width: 9em; 121 | clear: left; 122 | margin: 0 auto; 123 | } 124 | 125 | input:focus { 126 | background: #e3d5ba; 127 | } 128 | 129 | label { 130 | display: block; 131 | font-weight: bold; 132 | text-align: left; 133 | } 134 | 135 | input, label, button { 136 | margin: 5px 10px; 137 | } 138 | -------------------------------------------------------------------------------- /Hands-on Project 7-3/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 7-3 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 7-3 25 |

26 |
27 | 28 |
29 |

Lunch selections

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 |
Item total0.00
Tax0.00
Total with tax$0.00
63 |
64 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Hands-on Project 11-4/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 11 3 | Hands-on Project 11-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 640px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #FFCF40; 67 | width: 100%; 68 | color: black; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | width: 640px; 78 | text-align: left; 79 | background: white; 80 | padding: 20px; 81 | overflow: auto; 82 | } 83 | 84 | h2 { 85 | font-weight: bold; 86 | font-size: 30px; 87 | text-align: center; 88 | } 89 | 90 | /* form */ 91 | form { 92 | text-align: left; 93 | padding: 2em; 94 | background: ivory; 95 | border: 1px solid black; 96 | position: relative; 97 | margin: 1em auto; 98 | font-size: 1em; 99 | } 100 | 101 | #csset { 102 | visibility: hidden; 103 | } 104 | 105 | input, label { 106 | float: left; 107 | margin-bottom: 0.4em; 108 | } 109 | 110 | label { 111 | width: 12em; 112 | text-align: right; 113 | margin-right: 0.4em; 114 | line-height: 1.4em; 115 | } 116 | 117 | #uslabel { 118 | width: auto; 119 | margin-left: 1.4em; 120 | } 121 | 122 | #zipset label, #csset label { 123 | clear: left; 124 | } 125 | 126 | #city { 127 | width: 12em; 128 | } 129 | 130 | #state { 131 | width: 3em; 132 | } 133 | 134 | #zip { 135 | width: 6em; 136 | } 137 | 138 | -------------------------------------------------------------------------------- /Hands-on Project 6-1/script.js: -------------------------------------------------------------------------------- 1 | //Author: Lisa Kilker 2 | //Date: April 19, 2018 3 | //Hands-on Project 6-1 4 | 5 | "use strict"; 6 | var formValidity = true; 7 | 8 | /* validate required fields */ 9 | function validateRequired() { 10 | var inputElements = document.querySelectorAll("#contactinfo input"); 11 | var errorDiv = document.getElementById("errorText"); 12 | var elementCount = inputElements.length; 13 | var requiredValidity = true; 14 | var currentElement; 15 | 16 | try { 17 | for (var i = 0; i < elementCount; i++) { 18 | currentElement = inputElements[i]; 19 | 20 | if (currentElement.value === "") { 21 | currentElement.style.background = "rgb(255,233,233)"; 22 | requiredValidity = false; 23 | 24 | } else { 25 | currentElement.style.background = "white"; 26 | } 27 | } 28 | if (requiredValidity === false) { 29 | throw "Please complete all fields."; 30 | } 31 | errorDiv.style.display = "none"; 32 | errorDiv.innerHTML = ""; 33 | } 34 | catch(msg) { 35 | errorDiv.style.display = "block"; 36 | errorDiv.innerHTML = msg; 37 | formValidity = false; 38 | } 39 | } 40 | 41 | /* create event listeners */ 42 | function createEventListeners() { 43 | var form = document.getElementsByTagName("form")[0]; 44 | 45 | if (form.addEventListener) { 46 | form.addEventListener("submit", validateForm, false); 47 | } 48 | 49 | else if (form.attachEvent) { 50 | form.attachEvent("onsubmit", validateForm); 51 | } 52 | } 53 | 54 | function validateForm(evt) { 55 | 56 | if (evt.preventDefault) { 57 | evt.preventDefault(); 58 | 59 | } else { 60 | evt.returnValue = false; 61 | } 62 | formValidity = true; 63 | validateRequired(); 64 | 65 | if (formValidity === true) { 66 | document.getElementsByTagName("form")[0].submit(); 67 | } 68 | } 69 | 70 | function validateNumbers() { 71 | var numberInputs = document.querySelectorAll("#contactinfo input[type=number]"); 72 | var elementCount = numberInputs.length; 73 | var numErrorDiv = document.getElementById("numErrorText"); 74 | var numbersValidity = true; 75 | var currentElement; 76 | 77 | try { 78 | 79 | for (var i = 0; i < elementCount; i++) { 80 | currentElement = numberInputs[i]; 81 | 82 | if (isNan(currentElement.value) || (currentElement.valud === "")) { 83 | currentElement.style.background = "rgb(255,233,233"; 84 | numbersValidity = false; 85 | 86 | } else { 87 | currentElement.style.background = "white"; 88 | } 89 | } 90 | if (numbersValidity === false) { 91 | throw 92 | } 93 | numErrorDiv.Style.display = "none"; 94 | numErrorDiv.innerHTML = ""; 95 | } 96 | catch(msg){ 97 | numErrorDiv.style.display = "block"; 98 | numErrorDiv.innerHTML = msg; 99 | formValidity = false; 100 | } 101 | } 102 | 103 | function validateForm(evt) { 104 | 105 | if (evt.preventDefault) { 106 | evt.preventDefault(); // prevent form from submitting 107 | 108 | } else { 109 | evt.returnValue = false; // prevent form from submitting in IE8 110 | formValidity = true; // reset value for revalidation 111 | validateRequired(); validateNumbers(); 112 | 113 | if (formValidity === true) { 114 | document.getElementsByTagName("form")[0].submit(); 115 | } 116 | } 117 | } 118 | 119 | if (window.addEventListener) { 120 | window.addEventListener("load", createEventListeners, false); 121 | 122 | } else if (window.attachEvent) { 123 | window.attachEvent("onload", createEventListeners); 124 | } 125 | 126 | -------------------------------------------------------------------------------- /Hands-on Project 3-2/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 3 3 | Hands-on Project 3-2 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFE373; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | width: 960px; 71 | text-align: center; 72 | background: #BFA230; 73 | padding-bottom: 20px; 74 | border-bottom: 1px solid black; 75 | border-left: 1px solid black; 76 | border-right: 1px solid black; 77 | } 78 | 79 | article h2 { 80 | font-weight: bold; 81 | font-size: 24px; 82 | padding: 10px; 83 | } 84 | 85 | /* form */ 86 | 87 | #submitbutton input { 88 | font-family: georgia, "times new roman", times, serif; 89 | } 90 | fieldset { 91 | position: relative; 92 | padding: 1em; 93 | background: white; 94 | text-align: left; 95 | } 96 | form { 97 | background: white; 98 | padding: 10px 5px 7px 5px; 99 | margin: 0 auto; 100 | width: 750px; 101 | border: 2px solid black; 102 | } 103 | input { 104 | font-size: 1em; 105 | } 106 | input:focus { 107 | background: #e3d5ba; 108 | } 109 | label { 110 | display: block; 111 | position: relative; 112 | margin: 12px 0; 113 | } 114 | #contactinfo input { 115 | position: absolute; 116 | left: 100px; 117 | } 118 | #nameinput, #emailinput { 119 | width: 30em; 120 | } 121 | #phoneinput { 122 | width: 12em; 123 | } 124 | #submit { 125 | background: #e3d5ba; 126 | font-size: 1.25em; 127 | -webkit-border-top-left-radius: 10px; 128 | -webkit-border-bottom-right-radius: 10px; 129 | -moz-border-radius-topleft: 10px; 130 | -moz-border-radius-bottomright: 10px; 131 | border-top-left-radius: 10px; 132 | border-bottom-right-radius: 10px; 133 | } 134 | #submitbutton { 135 | padding: 0.5em 0; 136 | margin-bottom: 0; 137 | text-align: center; 138 | } 139 | -------------------------------------------------------------------------------- /Hands-on Project 6-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 6 3 | Hands-on Project 6-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFE373; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | width: 960px; 71 | text-align: center; 72 | background: #BFA230; 73 | padding-bottom: 20px; 74 | border-bottom: 1px solid black; 75 | border-left: 1px solid black; 76 | border-right: 1px solid black; 77 | } 78 | 79 | article h2 { 80 | font-weight: bold; 81 | font-size: 24px; 82 | padding: 10px; 83 | } 84 | 85 | form div { 86 | border: 1px solid red; 87 | background: rgb(255,233,233); 88 | width: 80%; 89 | margin: 0 auto; 90 | padding: 10px; 91 | display: none; 92 | } 93 | 94 | /* form */ 95 | 96 | fieldset { 97 | padding: 1em; 98 | background: white; 99 | text-align: right; 100 | } 101 | 102 | form { 103 | background: white; 104 | padding: 10px 5px 7px 5px; 105 | margin: 0 auto; 106 | width: 30em; 107 | border: 2px solid black; 108 | } 109 | 110 | input { 111 | font-size: 1em; 112 | float: left; 113 | } 114 | 115 | #ssn1, #ssn2, #ssn3 { 116 | display: inline-block; 117 | margin-right: 0.3em; 118 | } 119 | 120 | #ssn1 { 121 | width: 3em; 122 | } 123 | 124 | #ssn2 { 125 | width: 2em; 126 | } 127 | 128 | #ssn3 { 129 | width: 4em; 130 | } 131 | 132 | #ssn2label, #ssn3label { 133 | position: absolute; 134 | left: -5000px; 135 | } 136 | 137 | input:focus { 138 | background: #e3d5ba; 139 | } 140 | 141 | label { 142 | display: block; 143 | margin: 0.5em 1em 0 0; 144 | float: left; 145 | clear: left; 146 | width: 10em; 147 | } 148 | 149 | #submitsection { 150 | padding: 0.5em 0; 151 | text-align: center; 152 | } 153 | 154 | #submitBtn { 155 | float: none; 156 | } -------------------------------------------------------------------------------- /Hands-on Project 6-2/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 6 3 | Hands-on Project 6-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFE373; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | width: 960px; 71 | text-align: center; 72 | background: #BFA230; 73 | padding-bottom: 20px; 74 | border-bottom: 1px solid black; 75 | border-left: 1px solid black; 76 | border-right: 1px solid black; 77 | } 78 | 79 | article h2 { 80 | font-weight: bold; 81 | font-size: 24px; 82 | padding: 10px; 83 | } 84 | 85 | form div { 86 | border: 1px solid red; 87 | background: rgb(255,233,233); 88 | width: 80%; 89 | margin: 0 auto; 90 | padding: 10px; 91 | display: none; 92 | } 93 | 94 | /* form */ 95 | 96 | fieldset { 97 | padding: 1em; 98 | background: white; 99 | text-align: right; 100 | } 101 | 102 | form { 103 | background: white; 104 | padding: 10px 5px 7px 5px; 105 | margin: 0 auto; 106 | width: 30em; 107 | border: 2px solid black; 108 | } 109 | 110 | input { 111 | font-size: 1em; 112 | float: left; 113 | } 114 | 115 | #ssn1, #ssn2, #ssn3 { 116 | display: inline-block; 117 | margin-right: 0.3em; 118 | } 119 | 120 | #ssn1 { 121 | width: 3em; 122 | } 123 | 124 | #ssn2 { 125 | width: 2em; 126 | } 127 | 128 | #ssn3 { 129 | width: 4em; 130 | } 131 | 132 | #ssn2label, #ssn3label { 133 | position: absolute; 134 | left: -5000px; 135 | } 136 | 137 | input:focus { 138 | background: #e3d5ba; 139 | } 140 | 141 | label { 142 | display: block; 143 | margin: 0.5em 1em 0 0; 144 | float: left; 145 | clear: left; 146 | width: 10em; 147 | } 148 | 149 | #submitsection { 150 | padding: 0.5em 0; 151 | text-align: center; 152 | } 153 | 154 | #submitBtn { 155 | float: none; 156 | } -------------------------------------------------------------------------------- /Hands-on Project 7-2/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 7 3 | Hands-on Project 7-2 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 800px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #04819E; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | text-align: center; 78 | background: ivory; 79 | padding: 20px; 80 | } 81 | 82 | article h2 { 83 | font-weight: bold; 84 | font-size: 24px; 85 | padding: 10px; 86 | } 87 | 88 | /* form */ 89 | 90 | form { 91 | padding: 10px; 92 | height: 145px; 93 | } 94 | 95 | fieldset { 96 | margin-bottom: 10px; 97 | position: relative; 98 | padding: 2.5em 1em 0.5em 1em; 99 | background: #e3d5ba; 100 | float: left; 101 | width: 40%; 102 | height: 125px; 103 | } 104 | 105 | fieldset.button { 106 | width: 20%; 107 | } 108 | 109 | input { 110 | font-size: 1.1em; 111 | width: 4em; 112 | clear: left; 113 | font-family: Arial, Helvetica, sans-serif; 114 | text-align: center; 115 | } 116 | 117 | input:focus { 118 | background: #e3d5ba; 119 | } 120 | 121 | label { 122 | display: block; 123 | } 124 | 125 | input, label, button, form p { 126 | margin: 5px 10px; 127 | } 128 | 129 | p { 130 | clear: left; 131 | } 132 | 133 | #dateSelected { 134 | width: 180px; 135 | } 136 | 137 | #day { 138 | width: 120px; 139 | font-size: 1.1em; 140 | height: 1.6em; 141 | background: white; 142 | padding: 0.2em; 143 | margin: 10px auto; 144 | border: 1px solid rgb(164,164,164); 145 | } -------------------------------------------------------------------------------- /Hands-on Project 8-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 6 3 | Hands-on Project 6-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #04819E; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | width: 960px; 78 | text-align: left; 79 | background: ivory; 80 | padding: 20px; 81 | } 82 | 83 | h2 { 84 | font-weight: bold; 85 | font-size: 30px; 86 | text-align: center; 87 | } 88 | 89 | /* form */ 90 | form { 91 | padding: 10px; 92 | } 93 | 94 | fieldset { 95 | margin-bottom: 10px; 96 | position: relative; 97 | padding: 2.5em 1em 0.5em 1em; 98 | background: #e3d5ba; 99 | } 100 | 101 | #submit { 102 | font-family: arial, helvetica, sans-serif; 103 | font-weight: bold; 104 | } 105 | 106 | input { 107 | font-size: 1em; 108 | } 109 | 110 | #deliveryinfo, #submitbutton { 111 | border: none; 112 | } 113 | 114 | #deliveryinfo label { 115 | display: block; 116 | float: left; 117 | clear: left; 118 | margin-top: 5px; 119 | } 120 | 121 | #deliveryinfo input { 122 | display: block; 123 | margin-left: 130px; 124 | } 125 | 126 | #addrinput { 127 | width: 30em; 128 | } 129 | 130 | #fnameinput, #lnameinput, #cityinput, #accountidbox { 131 | width: 12em; 132 | } 133 | 134 | #stateinput { 135 | width: 3em; 136 | } 137 | 138 | #zipinput { 139 | width: 10em; 140 | } 141 | 142 | #submitBtn { 143 | font-size: 1.25em; 144 | } 145 | 146 | #submitbutton { 147 | background: inherit; 148 | border: none; 149 | padding: 0.5em 0 0 0; 150 | text-align: center; 151 | } 152 | -------------------------------------------------------------------------------- /Hands-on Project 1-4/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 1 3 | Hands-on Project 1-4 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 600px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #FFC340; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | text-align: center; 71 | background: white; 72 | border-bottom: 1px solid black; 73 | border-left: 1px solid black; 74 | border-right: 1px solid black; 75 | } 76 | 77 | article h2 { 78 | font-weight: bold; 79 | font-size: 24px; 80 | padding: 10px; 81 | } 82 | 83 | /* form */ 84 | form { 85 | background: #A67100; 86 | padding: 5px; 87 | margin: 0 auto; 88 | } 89 | fieldset { 90 | position: relative; 91 | padding: 1em 1em 0.5em 1em; 92 | background: #FFAE00; 93 | text-align: left; 94 | } 95 | legend span { 96 | position: absolute; 97 | left: 0; 98 | top: 0; 99 | font-size: 1.25em; 100 | margin-top: 0.5em; 101 | margin-left: 0.5em; 102 | } 103 | legend { 104 | font-family: georgia, "times new roman", times, serif; 105 | } 106 | input, textarea { 107 | font-size: 1em; 108 | } 109 | input:focus, textarea:focus { 110 | background: #e3d5ba; 111 | } 112 | textarea { 113 | display: block; 114 | } 115 | #addroptions { 116 | margin-bottom: 5px; 117 | padding-top: 2.5em; 118 | } 119 | #addroptions label span { 120 | font-weight: bold; 121 | } 122 | #addroptions label { 123 | display: block; 124 | margin: 0 20px; 125 | position: relative; 126 | float: left; 127 | } 128 | #addroptions label input { 129 | display: block; 130 | vertical-align: top; 131 | position: absolute; 132 | left: -20px; 133 | top: 0px; 134 | } 135 | #contactinfo { 136 | border: none; 137 | } 138 | #contactinfo label { 139 | display: block; 140 | position: relative; 141 | margin: 12px 0; 142 | } 143 | #contactinfo input { 144 | position: absolute; 145 | left: 120px; 146 | } 147 | #streetinput { 148 | width: 25em; 149 | } 150 | #cityinput { 151 | width: 15em; 152 | } 153 | #stateinput { 154 | width: 3em; 155 | } 156 | #zipinput { 157 | width: 5em; 158 | } 159 | -------------------------------------------------------------------------------- /Hands-on Project 1-3/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 1 3 | Hands-on Project 1-3 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 960px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | } 50 | 51 | ol, ul { 52 | list-style: none; 53 | } 54 | 55 | /* page header */ 56 | header { 57 | background: #93AD78; 58 | width: 100%; 59 | color: black; 60 | font-size: 48px; 61 | text-align: center; 62 | line-height: 1.5em; 63 | border-bottom: 1px solid black; 64 | border-left: 1px solid black; 65 | border-right: 1px solid black; 66 | } 67 | 68 | /* main content */ 69 | article { 70 | width: 960px; 71 | text-align: center; 72 | background: white; 73 | padding-bottom: 20px; 74 | border-bottom: 1px solid black; 75 | border-left: 1px solid black; 76 | border-right: 1px solid black; 77 | } 78 | 79 | article h2 { 80 | font-weight: bold; 81 | font-size: 24px; 82 | padding: 10px; 83 | } 84 | 85 | /* form */ 86 | 87 | legend, #submitbutton input { 88 | font-family: georgia, "times new roman", times, serif; 89 | } 90 | fieldset { 91 | margin-bottom: 10px; 92 | position: relative; 93 | padding: 2.5em 1em 0.5em 1em; 94 | background: #93AD78; 95 | text-align: left; 96 | } 97 | fieldset fieldset { 98 | padding-top: 5px; 99 | border: 2px solid #082008; 100 | } 101 | form { 102 | background: #082008; 103 | padding: 10px 5px 7px 5px; 104 | margin: 0 auto; 105 | width: 750px; 106 | } 107 | input, textarea { 108 | font-size: 1em; 109 | } 110 | input:focus, textarea:focus { 111 | background: #e3d5ba; 112 | } 113 | legend span { 114 | position: absolute; 115 | left: 0; 116 | top: 0; 117 | font-size: 1.25em; 118 | margin-top: 0.5em; 119 | margin-left: 0.5em; 120 | } 121 | textarea { 122 | display: block; 123 | } 124 | #checkin { 125 | float: left; 126 | width: 45%; 127 | } 128 | #checkout { 129 | float: right; 130 | width: 45%; 131 | } 132 | #contactinfo, #reserveinfo, #submitbutton { 133 | border: none; 134 | } 135 | #contactinfo label { 136 | display: block; 137 | position: relative; 138 | margin: 12px 0; 139 | } 140 | #contactinfo input { 141 | position: absolute; 142 | left: 100px; 143 | } 144 | #nameinput, #emailinput { 145 | width: 30em; 146 | } 147 | #phoneinput { 148 | width: 12em; 149 | } 150 | #submitbutton { 151 | border: none; 152 | background: #93AD78; 153 | padding: 0.5em 0; 154 | margin-bottom: 0; 155 | text-align: center; 156 | } -------------------------------------------------------------------------------- /Hands-on Project 9-2/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 9 3 | Hands-on Project 9-2 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 640px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #329D27; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | width: 640px; 78 | text-align: left; 79 | background: ivory; 80 | padding: 20px; 81 | } 82 | 83 | h2 { 84 | font-weight: bold; 85 | font-size: 30px; 86 | text-align: center; 87 | } 88 | 89 | #errorMessage { 90 | display: none; 91 | width: 80%; 92 | text-align: center; 93 | padding: 10px; 94 | margin: 15px auto 5px; 95 | background: #e3d5ba; 96 | color: black; 97 | border: 5px solid rgb(190,50,38); 98 | font-weight: bold; 99 | } 100 | 101 | 102 | /* form */ 103 | form { 104 | padding: 10px; 105 | } 106 | 107 | fieldset { 108 | margin-bottom: 10px; 109 | position: relative; 110 | padding: 2.5em 1em 0.5em 1em; 111 | background: #e3d5ba; 112 | } 113 | 114 | legend { 115 | font-family: arial, helvetica, sans-serif; 116 | font-weight: bold; 117 | position: absolute; 118 | top: 0; 119 | left: 0; 120 | font-size: 1.25em; 121 | margin-top: 0.5em; 122 | margin-left: 0.5em; 123 | } 124 | 125 | input { 126 | font-size: 1em; 127 | display: block; 128 | margin-left: 130px; 129 | } 130 | 131 | label { 132 | display: block; 133 | float: left; 134 | clear: left; 135 | margin-top: 5px; 136 | } 137 | 138 | #rememberinput, #rememberlabel { 139 | display: inline-block; 140 | float: none; 141 | clear: none; 142 | } 143 | 144 | #submitBtn { 145 | font-size: 1.25em; 146 | margin: 0 auto; 147 | } 148 | 149 | #submitbutton { 150 | background: inherit; 151 | border: none; 152 | padding: 0; 153 | text-align: center; 154 | } 155 | -------------------------------------------------------------------------------- /Hands-on Project 9-3/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 9 3 | Hands-on Project 9-2 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | max-width: 640px; 46 | background: white; 47 | margin: 0 auto; 48 | font-family: Arial, Helvetica, sans-serif; 49 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 50 | 0px 10px 10px rgba(50, 50, 50, 1), 51 | -10px 0px 10px rgba(50, 50, 50, 1); 52 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 53 | 0px 10px 10px rgba(50, 50, 50, 1), 54 | -10px 0px 10px rgba(50, 50, 50, 1); 55 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 56 | 0px 10px 10px rgba(50, 50, 50, 1), 57 | -10px 0px 10px rgba(50, 50, 50, 1); 58 | } 59 | 60 | ol, ul { 61 | list-style: none; 62 | } 63 | 64 | /* page header */ 65 | header { 66 | background: #329D27; 67 | width: 100%; 68 | color: #FFFFFF; 69 | font-size: 48px; 70 | text-align: center; 71 | line-height: 1.5em; 72 | border-bottom: 1px solid black; 73 | } 74 | 75 | /* main content */ 76 | article { 77 | width: 640px; 78 | text-align: left; 79 | background: ivory; 80 | padding: 20px; 81 | } 82 | 83 | h2 { 84 | font-weight: bold; 85 | font-size: 30px; 86 | text-align: center; 87 | } 88 | 89 | #errorMessage { 90 | display: none; 91 | width: 80%; 92 | text-align: center; 93 | padding: 10px; 94 | margin: 15px auto 5px; 95 | background: #e3d5ba; 96 | color: black; 97 | border: 5px solid rgb(190,50,38); 98 | font-weight: bold; 99 | } 100 | 101 | 102 | /* form */ 103 | form { 104 | padding: 10px; 105 | } 106 | 107 | fieldset { 108 | margin-bottom: 10px; 109 | position: relative; 110 | padding: 2.5em 1em 0.5em 1em; 111 | background: #e3d5ba; 112 | } 113 | 114 | legend { 115 | font-family: arial, helvetica, sans-serif; 116 | font-weight: bold; 117 | position: absolute; 118 | top: 0; 119 | left: 0; 120 | font-size: 1.25em; 121 | margin-top: 0.5em; 122 | margin-left: 0.5em; 123 | } 124 | 125 | input { 126 | font-size: 1em; 127 | display: block; 128 | margin-left: 130px; 129 | } 130 | 131 | label { 132 | display: block; 133 | float: left; 134 | clear: left; 135 | margin-top: 5px; 136 | } 137 | 138 | #rememberinput, #rememberlabel { 139 | display: inline-block; 140 | float: none; 141 | clear: none; 142 | } 143 | 144 | #submitBtn { 145 | font-size: 1.25em; 146 | margin: 0 auto; 147 | } 148 | 149 | #submitbutton { 150 | background: inherit; 151 | border: none; 152 | padding: 0; 153 | text-align: center; 154 | } 155 | -------------------------------------------------------------------------------- /Hands-on Project 4-1/tractor.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | Tuba Farm Equipment - Tractor Selector 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |

Tuba Farm Equipment

32 | 33 |
34 | 35 | 45 | 46 |
47 |

Tractor Selector

48 |
49 |
50 | How many acres do you cultivate? 51 | 52 | 53 |
54 |
55 | Which crops do you grow? 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
71 |
72 | How many months per year do you work your fields? 73 | 74 | 75 |
76 |
77 | Which is your preferred fuel source? 78 | 79 | 80 | 81 | 82 | 83 | 84 |
85 |
86 |
87 | 88 | 92 | 93 | 96 |
97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Hands-on Project 5-5/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 5-5 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Hands-on Project 5-5 25 |

26 |
27 | 28 |
29 |

United States Bill of Rights

30 |

Table of Contents

31 | 32 |

Amendment I

33 |

Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.

34 |

Amendment II

35 |

A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed.

36 |

Amendment III

37 |

No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to be prescribed by law.

38 |

Amendment IV

39 |

The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

40 |

Amendment V

41 |

No person shall be held to answer for a capital, or otherwise infamous crime, unless on a presentment or indictment of a Grand Jury, except in cases arising in the land or naval forces, or in the Militia, when in actual service in time of War or public danger; nor shall any person be subject for the same offence to be twice put in jeopardy of life or limb; nor shall be compelled in any criminal case to be a witness against himself, nor be deprived of life, liberty, or property, without due process of law; nor shall private property be taken for public use, without just compensation.

42 |

Amendment VI

43 |

In all criminal prosecutions, the accused shall enjoy the right to a speedy and public trial, by an impartial jury of the State and district wherein the crime shall have been committed, which district shall have been previously ascertained by law, and to be informed of the nature and cause of the accusation; to be confronted with the witnesses against him; to have compulsory process for obtaining witnesses in his favor, and to have the Assistance of Counsel for his defence.

44 |

Amendment VII

45 |

In Suits at common law, where the value in controversy shall exceed twenty dollars, the right of trial by jury shall be preserved, and no fact tried by a jury, shall be otherwise re-examined in any Court of the United States, than according to the rules of the common law.

46 |

Amendment VIII

47 |

Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted.

48 |

Amendment IX

49 |

The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

50 |

Amendment X

51 |

The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people.

52 |
53 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Hands-on Project 4-1/tuba.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 4 3 | Chapter case 4 | 5 | Tuba Farm Equipment 6 | Large format style sheet 7 | 8 | Filename: tuba.css 9 | */ 10 | 11 | /* apply a natural box layout model to all elements */ 12 | * { 13 | -moz-box-sizing: border-box; 14 | -webkit-box-sizing: border-box; 15 | box-sizing: border-box; 16 | } 17 | 18 | /* reset rules */ 19 | html, body, div, span, applet, object, iframe, 20 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 21 | a, abbr, acronym, address, big, cite, code, 22 | del, dfn, em, img, ins, kbd, q, s, samp, 23 | small, strike, strong, sub, sup, tt, var, 24 | b, u, i, center, 25 | dl, dt, dd, ol, ul, li, 26 | fieldset, form, label, legend, 27 | table, caption, tbody, tfoot, thead, tr, th, td, 28 | article, aside, canvas, details, embed, 29 | figure, figcaption, footer, header, hgroup, 30 | menu, nav, output, ruby, section, summary, 31 | time, mark, audio, video { 32 | margin: 0; 33 | padding: 0; 34 | border: 0; 35 | font-size: 100%; 36 | font: inherit; 37 | vertical-align: baseline; 38 | } 39 | 40 | /* HTML5 display-role reset for older browsers */ 41 | article, aside, details, figcaption, figure, 42 | footer, header, hgroup, menu, nav, section { 43 | display: block; 44 | } 45 | 46 | body { 47 | line-height: 1; 48 | width: 960px; 49 | margin: 0 auto; 50 | font-family: "Muli", arial, helvetica, sans-serif; 51 | background: rgb(117,192,62); 52 | position: relative; 53 | } 54 | 55 | ol, ul { 56 | list-style: none; 57 | } 58 | 59 | blockquote, q { 60 | quotes: none; 61 | } 62 | 63 | blockquote:before, blockquote:after, 64 | q:before, q:after { 65 | content: ''; 66 | content: none; 67 | } 68 | 69 | table { 70 | border-collapse: collapse; 71 | border-spacing: 0; 72 | } 73 | 74 | a:link, a:visited { 75 | text-decoration: none; 76 | color: inherit; 77 | } 78 | 79 | a:hover { 80 | text-decoration: none; 81 | color: inherit; 82 | } 83 | 84 | a:active { 85 | text-decoration: none; 86 | color: inherit; 87 | } 88 | 89 | /* container */ 90 | body div:first-child { 91 | background: rgb(14,119,62); 92 | } 93 | 94 | /* page header */ 95 | header { 96 | text-transform: uppercase; 97 | background: rgb(14,119,62); 98 | color: rgb(227,198,32); 99 | font-size: 3.7em; 100 | letter-spacing: -3px; 101 | } 102 | 103 | header img { 104 | display: block; 105 | } 106 | 107 | header h1 { 108 | float: right; 109 | width: 702px; 110 | text-align: center; 111 | margin-top: 0.3em; 112 | } 113 | 114 | /* navigation */ 115 | nav { 116 | text-transform: uppercase; 117 | width: 702px; 118 | position: absolute; 119 | left: 258px; 120 | top: 5.8em; 121 | } 122 | 123 | nav ul { 124 | text-align: center; 125 | padding: 0 10px; 126 | } 127 | 128 | nav ul li { 129 | display: inline-block; 130 | padding: 7px 8px; 131 | margin: 0 3px; 132 | background: rgb(116,191,68); 133 | border: 5px solid rgb(116,191,68); 134 | border-radius: 10px; 135 | } 136 | 137 | nav ul li:last-child { 138 | background: #6996D3; 139 | border: 5px solid #6996D3; 140 | } 141 | 142 | nav ul li:hover { 143 | background: rgb(227,198,32); 144 | } 145 | 146 | /* main content */ 147 | article { 148 | width: 702px; 149 | float: right; 150 | padding: 1em; 151 | background: white; 152 | } 153 | 154 | article h2 { 155 | font-size: 1.2em; 156 | font-weight: bold; 157 | text-align: left; 158 | margin: 0 0 10px 51px; 159 | } 160 | 161 | form { 162 | width: 600px; 163 | margin: 0 auto; 164 | } 165 | 166 | fieldset { 167 | margin: 10px; 168 | padding: 20px 10px 10px; 169 | background: rgb(164,188,149); 170 | position: relative; 171 | border-radius: 10px; 172 | } 173 | 174 | legend span { 175 | display: block; 176 | position: relative; 177 | top: 1em; 178 | font-weight: bold; 179 | } 180 | 181 | label { 182 | margin-right: 5px; 183 | } 184 | 185 | /* acres text box */ 186 | #acres { 187 | width: 7em; 188 | } 189 | 190 | /* months text box */ 191 | #months { 192 | width: 3em; 193 | } 194 | 195 | /* sidebar */ 196 | aside { 197 | width: 258px; 198 | padding: 1em; 199 | color: rgb(227,198,32); 200 | height: 100%; 201 | } 202 | 203 | aside h2 { 204 | font-size: 1.2em; 205 | font-weight: bold; 206 | text-align: center; 207 | } 208 | 209 | aside p { 210 | padding: 1em; 211 | } 212 | 213 | /* footer */ 214 | footer { 215 | width: 100%; 216 | font-size: 14px; 217 | padding: 10px; 218 | clear: both; 219 | background: black; 220 | color: rgb(227,198,32); 221 | } 222 | 223 | footer p { 224 | text-align: center; 225 | } -------------------------------------------------------------------------------- /Hands-on Project 4-1/tubaie.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 4 3 | Chapter case 4 | 5 | Tuba Farm Equipment 6 | Large format style sheet 7 | 8 | Filename: tuba.css 9 | */ 10 | 11 | /* apply a natural box layout model to all elements */ 12 | * { 13 | -moz-box-sizing: border-box; 14 | -webkit-box-sizing: border-box; 15 | box-sizing: border-box; 16 | } 17 | 18 | /* reset rules */ 19 | html, body, div, span, applet, object, iframe, 20 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 21 | a, abbr, acronym, address, big, cite, code, 22 | del, dfn, em, img, ins, kbd, q, s, samp, 23 | small, strike, strong, sub, sup, tt, var, 24 | b, u, i, center, 25 | dl, dt, dd, ol, ul, li, 26 | fieldset, form, label, legend, 27 | table, caption, tbody, tfoot, thead, tr, th, td, 28 | article, aside, canvas, details, embed, 29 | figure, figcaption, footer, header, hgroup, 30 | menu, nav, output, ruby, section, summary, 31 | time, mark, audio, video { 32 | margin: 0; 33 | padding: 0; 34 | border: 0; 35 | font-size: 100%; 36 | font: inherit; 37 | vertical-align: baseline; 38 | } 39 | 40 | /* HTML5 display-role reset for older browsers */ 41 | article, aside, details, figcaption, figure, 42 | footer, header, hgroup, menu, nav, section { 43 | display: block; 44 | } 45 | 46 | body { 47 | line-height: 1; 48 | width: 960px; 49 | margin: 0 auto; 50 | font-family: "Muli", arial, helvetica, sans-serif; 51 | background: rgb(117,192,62); 52 | position: relative; 53 | } 54 | 55 | ol, ul { 56 | list-style: none; 57 | } 58 | 59 | blockquote, q { 60 | quotes: none; 61 | } 62 | 63 | blockquote:before, blockquote:after, 64 | q:before, q:after { 65 | content: ''; 66 | content: none; 67 | } 68 | 69 | table { 70 | border-collapse: collapse; 71 | border-spacing: 0; 72 | } 73 | 74 | a:link, a:visited { 75 | text-decoration: none; 76 | color: inherit; 77 | } 78 | 79 | a:hover { 80 | text-decoration: none; 81 | color: inherit; 82 | } 83 | 84 | a:active { 85 | text-decoration: none; 86 | color: inherit; 87 | } 88 | 89 | /* container */ 90 | body div:first-child { 91 | background: rgb(14,119,62); 92 | } 93 | 94 | /* page header */ 95 | header { 96 | text-transform: uppercase; 97 | background: rgb(14,119,62); 98 | color: rgb(227,198,32); 99 | font-size: 3.7em; 100 | letter-spacing: -3px; 101 | } 102 | 103 | header img { 104 | display: block; 105 | } 106 | 107 | header h1 { 108 | float: right; 109 | width: 702px; 110 | text-align: center; 111 | margin-top: 0.3em; 112 | } 113 | 114 | /* navigation */ 115 | nav { 116 | text-transform: uppercase; 117 | width: 702px; 118 | position: absolute; 119 | left: 258px; 120 | top: 5.8em; 121 | } 122 | 123 | nav ul { 124 | text-align: center; 125 | padding: 0 10px; 126 | } 127 | 128 | nav ul li { 129 | display: inline-block; 130 | padding: 7px 8px; 131 | margin: 0 3px; 132 | background: rgb(116,191,68); 133 | border: 5px solid rgb(116,191,68); 134 | border-radius: 10px; 135 | } 136 | 137 | nav ul li:last-child { 138 | background: #6996D3; 139 | border: 5px solid #6996D3; 140 | } 141 | 142 | nav ul li:hover { 143 | background: rgb(227,198,32); 144 | } 145 | 146 | /* main content */ 147 | article { 148 | width: 702px; 149 | float: right; 150 | padding: 1em; 151 | background: white; 152 | } 153 | 154 | article h2 { 155 | font-size: 1.2em; 156 | font-weight: bold; 157 | text-align: left; 158 | margin: 0 0 10px 51px; 159 | } 160 | 161 | form { 162 | width: 600px; 163 | margin: 0 auto; 164 | } 165 | 166 | fieldset { 167 | margin: 10px; 168 | padding: 20px 10px 10px; 169 | background: rgb(164,188,149); 170 | position: relative; 171 | border-radius: 10px; 172 | } 173 | 174 | legend span { 175 | display: block; 176 | position: relative; 177 | top: -0.5em; 178 | font-weight: bold; 179 | } 180 | 181 | label { 182 | margin-right: 5px; 183 | } 184 | 185 | /* acres text box */ 186 | #acres { 187 | width: 7em; 188 | } 189 | 190 | /* months text box */ 191 | #months { 192 | width: 3em; 193 | } 194 | 195 | /* sidebar */ 196 | aside { 197 | width: 258px; 198 | padding: 1em; 199 | color: rgb(227,198,32); 200 | height: 100%; 201 | } 202 | 203 | aside h2 { 204 | font-size: 1.2em; 205 | font-weight: bold; 206 | text-align: center; 207 | } 208 | 209 | aside p { 210 | padding: 1em; 211 | } 212 | 213 | /* footer */ 214 | footer { 215 | width: 100%; 216 | font-size: 14px; 217 | padding: 10px; 218 | clear: both; 219 | background: black; 220 | color: rgb(227,198,32); 221 | } 222 | 223 | footer p { 224 | text-align: center; 225 | } -------------------------------------------------------------------------------- /Hands-on Project 6-2/script.js: -------------------------------------------------------------------------------- 1 | //Author: Lisa Kilker 2 | //Date: April 19, 2018 3 | //Hands-on Project 6-2 4 | 5 | "use strict"; 6 | var formValidity = true; 7 | 8 | function validateRequired() { //validates required fields 9 | var inputElements = document.querySelectorAll("#contactinfo input"); 10 | var errorDiv = document.getElementById("errorText"); 11 | var elementCount = inputElements.length; 12 | var requiredValidity = true; 13 | var currentElement; 14 | 15 | try { 16 | for (var i = 0; i < elementCount; i++) { 17 | //validates all input elements in fieldset 18 | currentElement = inputElements[i]; 19 | 20 | if (currentElement.value === "") { 21 | currentElement.style.background = "rgb(255,233,233)"; 22 | requiredValidity = false; 23 | 24 | } else { 25 | currentElement.style.background = "white"; 26 | } 27 | } 28 | if (requiredValidity === false) { 29 | throw "Please complete all fields."; 30 | } 31 | errorDiv.style.display = "none"; 32 | errorDiv.innerHTML = ""; 33 | } 34 | catch(msg) { 35 | errorDiv.style.display = "block"; 36 | errorDiv.innerHTML = msg; 37 | formValidity = false; 38 | } 39 | } 40 | 41 | function createEventListeners() { //create event listeners 42 | var form = document.getElementsByTagName("form")[0]; 43 | 44 | if (form.addEventListener) { 45 | form.addEventListener("submit", validateForm, false); 46 | } 47 | 48 | else if (form.attachEvent) { 49 | form.attachEvent("onsubmit", validateForm); 50 | } 51 | } 52 | 53 | function validateForm(evt) { //validates form 54 | 55 | if (evt.preventDefault) { 56 | evt.preventDefault(); //prevents form from submitting 57 | 58 | } else { 59 | evt.returnValue = false; //prevents form from submitting in IE8 60 | } 61 | formValidity = true; //resets value for revalidation 62 | validateRequired(); 63 | 64 | if (formValidity === true) { 65 | document.getElementsByTagName("form")[0].submit(); 66 | } 67 | } 68 | 69 | function validateNumbers() { //validates number fields for older browsers 70 | var numberInputs = document.querySelectorAll("#contactinfo input[type=number]"); 71 | var elementCount = numberInputs.length; 72 | var numErrorDiv = document.getElementById("numErrorText"); 73 | var numbersValidity = true; 74 | var currentElement; 75 | 76 | try { 77 | 78 | for (var i = 0; i < elementCount; i++) { 79 | //validates all input elements of type "number" in fieldset 80 | currentElement = numberInputs[i]; 81 | 82 | if (isNan(currentElement.value) || (currentElement.valud === "")) { 83 | currentElement.style.background = "rgb(255,233,233"; 84 | numbersValidity = false; 85 | 86 | } else { 87 | currentElement.style.background = "white"; 88 | } 89 | } 90 | if (numbersValidity === false) { 91 | throw 92 | } 93 | numErrorDiv.Style.display = "none"; 94 | numErrorDiv.innerHTML = ""; 95 | } 96 | catch(msg){ 97 | numErrorDiv.style.display = "block"; 98 | numErrorDiv.innerHTML = msg; 99 | formValidity = false; 100 | } 101 | } 102 | 103 | function validateForm(evt) { 104 | 105 | if (evt.preventDefault) { 106 | evt.preventDefault(); //prevent form from submitting 107 | 108 | } else { 109 | evt.returnValue = false; //prevent form from submitting in IE8 110 | formValidity = true; //reset value for revalidation 111 | validateRequired(); validateNumbers(); 112 | 113 | if (formValidity === true) { 114 | document.getElementsByTagName("form")[0].submit(); 115 | } 116 | } 117 | } 118 | 119 | function zeroPlaceholder() { //remove fallback placeholder text 120 | var addressBox = document.getElementById("addrinput"); 121 | addressBox.style.color = "black"; 122 | 123 | if (addressBox.value === addressBox.placeholder) { 124 | addressBox.value = ""; 125 | } 126 | } 127 | 128 | function checkPlaceholder() { //restores placeholder text if box contains no user entry 129 | var addressBox = document.getElementById("addrinput"); 130 | 131 | if (addressBox.value === "") { 132 | addressBox.style.color = "rgb(178,184,183)"; 133 | addrsesBox.value = addressBox.placeholder; 134 | } 135 | } 136 | 137 | function generatePlaceholder() { //adds placeholder text for browsers that don't support the placeholder attribute 138 | 139 | if (!Modernizr.input.placehoder) { 140 | var addressBox = document.getElementById("addrinput"); 141 | addressBox.value = addressBox.placeholder; 142 | addressBox.style.color = "rgb(178,184,183)"; 143 | 144 | if (addressBox.addEventListener) { 145 | addressBox.addEventListener("focus", zeroPlaceholder, false); 146 | 147 | } else if (addressBox.attachEvent) { 148 | addressBox.attachEvent("onfocus", zeroPlaceholder); 149 | addressBox.attachEvent("onblur", checkPlaceholder); 150 | } 151 | } 152 | } 153 | 154 | if (window.addEventListener) { //run setup fnction when page finishes loading 155 | //window.addEventListener("load", createEventListeners, false); 156 | window.addEventListener("load", setUpPage, false); 157 | 158 | } else if (window.attachEvent) { 159 | //window.attachEvent("onload", createEventListeners); 160 | window.attachEvent("onload", setUpPage); 161 | } 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /Hands-on Project 10-1/styles.css: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | Chapter 10 3 | Hands-on Project 10-1 4 | 5 | Filename: styles.css 6 | */ 7 | 8 | /* apply a natural box layout model to all elements */ 9 | * { 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | } 14 | 15 | /* reset rules */ 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td, 25 | article, aside, canvas, details, embed, 26 | figure, figcaption, footer, header, hgroup, 27 | menu, nav, output, ruby, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | /* HTML5 display-role reset for older browsers */ 38 | article, aside, details, figcaption, figure, 39 | footer, header, hgroup, menu, nav, section { 40 | display: block; 41 | } 42 | 43 | body { 44 | line-height: 1; 45 | min-width: 320px; 46 | max-width: 640px; 47 | background: white; 48 | margin: 0 auto; 49 | font-family: Arial, Helvetica, sans-serif; 50 | -webkit-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 51 | 0px 10px 10px rgba(50, 50, 50, 1), 52 | -10px 0px 10px rgba(50, 50, 50, 1); 53 | -moz-box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 54 | 0px 10px 10px rgba(50, 50, 50, 1), 55 | -10px 0px 10px rgba(50, 50, 50, 1); 56 | box-shadow: 10px 0px 10px rgba(50, 50, 50, 1), 57 | 0px 10px 10px rgba(50, 50, 50, 1), 58 | -10px 0px 10px rgba(50, 50, 50, 1); 59 | } 60 | 61 | ol, ul { 62 | list-style: none; 63 | } 64 | 65 | /* page header */ 66 | header { 67 | background: #04819E; 68 | width: 100%; 69 | color: #FFFFFF; 70 | font-size: 48px; 71 | text-align: center; 72 | line-height: 1.5em; 73 | border-bottom: 1px solid black; 74 | } 75 | 76 | /* main content */ 77 | article { 78 | width: 100%; 79 | text-align: center; 80 | background: ivory; 81 | padding-bottom: 20px; 82 | overflow: auto; 83 | } 84 | 85 | h2 { 86 | font-weight: bold; 87 | font-size: 24px; 88 | padding: 10px; 89 | } 90 | 91 | #grid { 92 | overflow: auto; 93 | width: 266px; 94 | margin: 0 auto; 95 | border: 1px solid black; 96 | } 97 | 98 | #grid div { 99 | float: left; 100 | width: 88px; 101 | height: 99px; 102 | border: 1px solid black; 103 | } 104 | 105 | #top1, #bottom1 { 106 | clear: left; 107 | } 108 | 109 | #image { 110 | float: left; 111 | margin-left: 50px; 112 | } 113 | 114 | #image img { 115 | border: 10px solid darkgoldenrod; 116 | } 117 | 118 | #pieces { 119 | position: relative; 120 | height: 110px; 121 | } 122 | 123 | #pieces div { 124 | position: absolute; 125 | width: 14.6667%; 126 | margin: 1%; 127 | padding: 1em 0; 128 | height: 110px; 129 | } 130 | 131 | #piece1 { 132 | left: 0px; 133 | background: url("images/frog_03.png") center center no-repeat; 134 | } 135 | 136 | #piece2 { 137 | left: 16.6667%; 138 | background: url("images/frog_02.png") center center no-repeat; 139 | } 140 | 141 | #piece3 { 142 | left: 33.3334%; 143 | background: url("images/frog_05.png") center center no-repeat; 144 | } 145 | 146 | #piece4 { 147 | left: 50%; 148 | background: url("images/frog_01.png") center center no-repeat; 149 | } 150 | 151 | #piece5 { 152 | left: 66.6667%; 153 | background: url("images/frog_06.png") center center no-repeat; 154 | } 155 | 156 | #piece6 { 157 | left: 83.3334%; 158 | background: url("images/frog_04.png") center center no-repeat; 159 | } 160 | 161 | @media all and (max-width: 550px) { 162 | #grid { 163 | margin: 0 auto; 164 | width: 134px; 165 | } 166 | #grid div { 167 | width: 44px; 168 | height: 49px; 169 | } 170 | #image { 171 | float: left; 172 | width: 100%; 173 | text-align: center; 174 | margin: 0 0 20px; 175 | } 176 | #piece1 { 177 | background: url("images/frog_03_sm.png") center center no-repeat; 178 | } 179 | 180 | #piece2 { 181 | background: url("images/frog_02_sm.png") center center no-repeat; 182 | } 183 | 184 | #piece3 { 185 | background: url("images/frog_05_sm.png") center center no-repeat; 186 | } 187 | 188 | #piece4 { 189 | background: url("images/frog_01_sm.png") center center no-repeat; 190 | } 191 | 192 | #piece5 { 193 | background: url("images/frog_06_sm.png") center center no-repeat; 194 | } 195 | 196 | #piece6 { 197 | background: url("images/frog_04_sm.png") center center no-repeat; 198 | } 199 | } -------------------------------------------------------------------------------- /Hands-on Project 4-1/tuba.js: -------------------------------------------------------------------------------- 1 | /* JavaScript 6th Edition 2 | // Chapter 4 3 | // Chapter case 4 | 5 | // Tuba Farm Equipment 6 | // Variables and functions 7 | // Author: Lisa Kilker 8 | // Date: April 15, 2018 9 | 10 | // Filename: Hands-on Project 4-1 11 | */ 12 | 13 | // global variables tracking status of each form section 14 | var acresComplete = false; 15 | var cropsComplete = false; 16 | var monthsComplete = false; 17 | var fuelComplete = true; 18 | 19 | // global variables referencing sidebar h2 and p elements 20 | var messageHeadElement = document.getElementById("messageHead"); 21 | var messageElement = document.getElementById("message"); 22 | 23 | // global variables referencing fieldset elements 24 | var acresFieldset = document.getElementsByTagName("fieldset")[0]; 25 | var cropsFieldset = document.getElementsByTagName("fieldset")[1]; 26 | var monthsFieldset = document.getElementsByTagName("fieldset")[2]; 27 | var fuelFieldset = document.getElementsByTagName("fieldset")[3]; 28 | 29 | // global variables referencing text input elements 30 | var monthsBox = document.forms[0].months; 31 | var acresBox = document.forms[0].acres; 32 | 33 | // verify acres text box entry is a positive number 34 | function verifyAcres() { 35 | testFormCompleteness(); 36 | } 37 | 38 | // verify at least one crops checkbox is checked 39 | function verifyCrops() { 40 | // testFormCompleteness(); 41 | try { 42 | for (var i = 0; i < 7; i++) { 43 | if (cropsFieldset.getElementsByTagName("input")[i].checked) { 44 | cropsComplete = true; 45 | messageElement.innerHTML = ""; //clear previous message 46 | testFormCompleteness(); 47 | i = 8; 48 | } 49 | } 50 | if (i === 7) { 51 | throw "Please select at least one crop." ; 52 | } 53 | } 54 | catch(message) { 55 | cropsComplete = false; 56 | messageHeadElement.innerHTML = ""; //removes heading 57 | messageElement.innerHTML = message; //display error message 58 | } 59 | } 60 | 61 | // verify months text box entry is between 1 and 12 62 | function verifyMonths() { 63 | testFormCompleteness(); 64 | } 65 | 66 | // verify that a fuel option button is selected 67 | function verifyFuel() { 68 | testFormCompleteness(); 69 | } 70 | 71 | // check if all four form sections are completed 72 | function testFormCompleteness() { 73 | if (acresComplete && cropsComplete && monthsComplete && fuelComplete) { 74 | createRecommendation(); 75 | } 76 | } 77 | 78 | // generate tractor recommendation based on user selections 79 | function createRecommendation() { 80 | if (acresBox.value >= 5000) { // 5000 acres or less, no crop test needed 81 | if (monthsBox.value <= 10) { // 10+ months of farming per year 82 | messageHeadElement.innerHTML = "E3250"; 83 | messageElement.innerHTML = "A workhorse for a small farm or a big backyard. A medium- to heavy-duty tractor that can haul whatever you throw at it year-round."; 84 | } else { // 9 or fewer months per year 85 | messageHeadElement.innerHTML = "E2600"; 86 | messageElement.innerHTML = "Perfect for a small farm, or just a big backyard. A light- to medium-duty tractor that can make short work of most any chore."; 87 | } 88 | } else { // more than 5000 acres 89 | if (monthsBox.value <= 9) { // 9 or fewer months per year, no crop test needed 90 | messageHeadElement.innerHTML = "W1205"; 91 | messageElement.innerHTML = "Can't be beat for the general tasks of a large farm. Medium- to heavy-duty muscle that's there then you need it."; 92 | } else { // 10+ months of farming per year 93 | if (document.getElementById("wheat").checked || document.getElementById("corn").checked && document.getElementById("soy").checked) { 94 | messageHeadElement.innerHTML = "W2500"; 95 | messageElement.innerHTML = "Our heavy-duty tractor designed especially for the needs of wheat, corn, and soy farmers. A reliable piece of equipment that you can turn to all year long."; 96 | } else { 97 | messageHeadElement.innerHTML = "W2550"; 98 | messageElement.innerHTML = "Our heavy-duty tractor for general use. A reliable piece of equipment that you can turn to all year long."; 99 | } 100 | } 101 | } 102 | if (document.getElementById("E85").checked) { // add suffix to model name based on fuel choice 103 | messageHeadElement.innerHTML += "E"; 104 | } else if (document.getElementById("biodiesel").checked) { 105 | messageHeadElement.innerHTML = "B"; 106 | } else { 107 | messageHeadElement.innerHTML += "D"; 108 | } 109 | } 110 | 111 | // create event listeners for all input elements 112 | function createEventListeners() { 113 | acresBox.value = ""; // clear acres text box on page load 114 | monthsBox.value = ""; // clear months text box on page load 115 | 116 | if (acresBox.addEventListener) { 117 | acresBox.addEventListener("input", verifyAcres, false); 118 | } else if (acresBox.attachEvent) { 119 | acresBox.attachEvent("onchange", verifyAcres); 120 | } 121 | 122 | var cropsBox; 123 | for (var i = 0; i < 7; i++) { 124 | cropsBox = cropsFieldset.getElementsByTagName("input")[i]; 125 | cropsBox.checked = false; 126 | if (cropsBox.addEventListener) { 127 | cropsBox.addEventListener("click", verifyCrops, false); 128 | } else if (cropsBox.attachEvent) { 129 | cropsBox.attachEvent("onclick", verifyCrops); 130 | } 131 | } 132 | 133 | if (monthsBox.addEventListener) { 134 | monthsBox.addEventListener("input", verifyMonths, false); 135 | } else if (monthsBox.attachEvent) { 136 | monthsBox.attachEvent("onchange", verifyMonths); 137 | } 138 | 139 | var fuelBox; 140 | for (var i = 0; i < 3; i++) { 141 | fuelBox = fuelFieldset.getElementsByTagName("input")[i]; 142 | fuelBox.checked = false; 143 | if (fuelBox.addEventListener) { 144 | fuelBox.addEventListener("click", verifyFuel, false); 145 | } else if (fuelBox.attachEvent) { 146 | fuelBox.attachEvent("onclick", verifyFuel); 147 | } 148 | } 149 | } 150 | 151 | // create event listeners when page finishes loading 152 | if (window.addEventListener) { 153 | window.addEventListener("load", createEventListeners, false); 154 | } else if (window.attachEvent) { 155 | window.attachEvent("onload", createEventListeners); 156 | } -------------------------------------------------------------------------------- /Hands-on Project 1-3/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | Hands-on Project 1-3 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |

25 | Hands-on Project 1-3 26 |

27 |
28 | 29 |
30 |

Order Form

31 |
32 |
33 | Contact Information 34 | 38 | 42 | 46 |
47 |
48 | Reservation Information 49 |
50 | Pickup date 51 | 65 | 98 | 103 |
104 |
105 | Dropoff date 106 | 120 | 153 | 158 |
159 |
160 |
161 | 162 |
163 |
164 |
165 | 166 | 167 | -------------------------------------------------------------------------------- /Hands-on Project 11-1/modernizr.custom.65897.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2 | * Build: http://modernizr.com/download/#-input-inputtypes-shiv-cssclasses-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function v(a){j.cssText=a}function w(a,b){return v(prefixes.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}function A(){e.input=function(c){for(var d=0,e=c.length;d",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f