The next several exercises are timed. If you type slowly or dislike time pressure, feel free to increase the allotted time.
Name and email required. Check any number of boxes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
0
0
0
Measure the height of the window and assign the number to a variable. Make up the variable name. | var windowHeight = $(window).height(); | ^ *var .+ = \$\(window\)\.height\(\); *$ | |
Fill in the blank to scroll the amount specified by the variable. | $(_____).scrollTop(windowHeight); | "body" | ^ *•body• *$ |
Fill in the blank to scroll the amount specified by the variable. | $("body")._________(windowHeight); | scrollTop | ^ *scrollTop *$ |
Fill in the blank to scroll the amount specified by the variable windowHeight. | $("body").scrollTop(____________); | windowHeight | ^ *windowHeight *$ |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to scroll the amount specified by the variable. | $("body").scrollTop(scrollAmount); | ||
Scroll the amount specified by the variable oneScreen. | $("body").scrollTop(oneScreen); | $`(`"`body`"`)`.`scrollTop`(`oneScreen`)`; | |
Scroll down 200 pixels. | $("body").scrollTop(200); | ||
Scroll down by the amount specified by a variable. Make up the variable name. | $("body").scrollTop(scrollAmount); | ^ *\$\(•body•\)\.scrollTop\(.+\); *$ | |
Measure the window height and assign the number to a variable. Make up the variable name. | var windowHeight = $(window).height(); | ^ *var .+ = \$\(window\)\.height\(\); *$ | |
Use succinct coding (a single statement) to scroll down one window height. | $("body").scrollTop($(window).height()); | ^ *\$\(•body•\)\.scrollTop\(\$\(window\)\.height\(\)\); *$ | |
When a button is clicked, scroll down by an amount specified by a variable. Make up the id of the button and the variable name. | $("button#read_more").on("click", function() { $("body").scrollTop(windowHeight); }); | ^ *\$\(•button#.+•\)\.on\(•click•, function\(\) {\n *\$\(•body•\)\.scrollTop\(.+\);\n}\); *$ | |
When a button is clicked, use succinct code to scroll down by the window height. Make up the id of the button. | $("button#read_more").on("click", function() { $("body").scrollTop($(window).height()); }); | ^ *\$\(•button#.+•\)\.on\(•click•, function\(\) {\n *\$\(•body•\)\.scrollTop\(\$\(window\)\.height\(\)\);\n}\); *$ | |
Scroll down 200 pixels. | $("body").scrollTop(200); | ^ *\$\(•body•\)\.scrollTop\(200\); *$ | |
Scroll down by the amount specified by a variable. Make up the variable name. | $("body").scrollTop(scrollAmount); | ^ *\$\(•body•\)\.scrollTop\(.+\); *$ | |
Measure the window height and assign the number to a variable. Make up the variable name. | var windowHeight = $(window).height(); | ^ *var .+ = \$\(window\)\.height\(\); *$ | |
Use succinct coding (a single statement) to scroll down one window height. | $("body").scrollTop($(window).height()); | ^ *\$\(•body•\)\.scrollTop\(\$\(window\)\.height\(\)\); *$ | |
When a button is clicked, scroll down by an amount specified by a variable. Make up the id of the button and the variable name. | $("button#read_more").on("click", function() { $("body").scrollTop(windowHeight); }); | ^ *\$\(•button#.+•\)\.on\(•click•, function\(\) {\n *\$\(•body•\)\.scrollTop\(.+\);\n}\); *$ | |
When a button is clicked, use succinct code to scroll down by the window height. Make up the id of the button. | $("button#read_more").on("click", function() { $("body").scrollTop($(window).height()); }); | ^ *\$\(•button#.+•\)\.on\(•click•, function\(\) {\n *\$\(•body•\)\.scrollTop\(\$\(window\)\.height\(\)\);\n}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/q9Lk6oy9/ | |||
http://jsfiddle.net/ASmarterWayToLearn/23pg7e8n/ |