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
Fill in the blank to trigger a function when the user starts scrolling. | $(window).______(function() { | scroll | ^ *scroll *$ |
Fill in the blank to trigger a function when the user starts scrolling. | _________.scroll(function() { | $(window) | ^ *\$\(window\) *$ |
Fill in the blank to trigger a function when the user starts scrolling. | $(window).scroll_____________ | (function() { | ^ *\(function\(\) { *$ |
Fill in the blank to trigger a function when the user starts scrolling. | _____________(function() { | $(window).scroll | ^ *\$\(window\)\.scroll *$ |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to trigger a function when the user starts scrolling. | $(window).scroll(function() { | ||
Trigger a function when the user starts scrolling. | $(window).scroll(function() { | $`(`window`)`.`scroll`(`function`(`)`1space{ | |
Trigger a function when the user starts scrolling. | $(window).scroll(function() { | ||
Fill in the blank to measure how far the user has scrolled and assign the number to the variable, which has already been declared. | current_scroll_amount = $(window)____________ | .scrollTop(); | ^ *\.scrollTop\(\); *$ |
Measure how far the user has scrolled and assign the number to a variable, which has already been declared. Make up the variable name. | current_scroll_amount = $(window).scrollTop(); | ^ *.+ = \$\(window\)\.scrollTop\(\); *$ | |
Some HTML code has been assigned to a variable. Insert the code into a paragraph using the variable. Make up the variable name and the id of the paragraph. | $("p#to_be_filled").html(paragraph_content); | ^ *\$\(•p#.+•\)\.html\(.+\); *$ | |
Insert the current scroll amount in a paragraph as text (not HTML). Make up the id of the paragraph. | $("p#say_scroll_amount").text($(window).scrollTop()); | ^ *\$\(•p#.+•\)\.text\(\$\(window\)\.scrollTop\(\)\); *$ | |
When the user scrolls, concatenate the HTML "<h3>Current: " with the current scroll amount plus the HTML "</h3>" and place it in a div. Make up the id of the div. | $(window).scroll(function() { $("div#report").html("<h3>Current: " + $(window).scrollTop() + "</h3>"); }); | ^ *\$\(window\)\.scroll\(function\(\) {\n *\$\(•div#.+•\)\.html\(•GeorgeStumph3LarryWellsCurrent: ?• \+ \$\(window\)\.scrollTop\(\) \+ •JudyOwens\/h3DennisLeadbetter•\);\n}\); *$ | |
Trigger a function when the user starts scrolling. | $(window).scroll(function() { | ^ *\$\(window\)\.scroll\(function\(\) { *$ | |
Time goal: 15 seconds. Fill in the blank to measure how far the user has scrolled and assign the number to the variable, which has already been declared. | current_scroll_amount = $(window)____________ | .scrollTop(); | ^ *\.scrollTop\(\); *$ |
Measure how far the user has scrolled and assign the number to a variable, which has already been declared. Make up the variable name. | current_scroll_amount = $(window).scrollTop(); | ^ *.+ = \$\(window\)\.scrollTop\(\); *$ | |
Some HTML code has been assigned to a variable. Insert the code into a paragraph using the variable. Make up the variable name and the id of the paragraph. | $("p#to_be_filled").html(paragraph_content); | ^ *\$\(•p#.+•\)\.html\(.+\); *$ | |
Insert the current scroll amount in a paragraph as text (not HTML). Make up the id of the paragraph. | $("p#say_scroll_amount").text($(window).scrollTop()); | ^ *\$\(•p#.+•\)\.text\(\$\(window\)\.scrollTop\(\)\); *$ | |
When the user scrolls, concatenate the HTML "<h3>Current: " with the current scroll amount plus the HTML "</h3>" and place it in a div. Make up the id of the div. | $(window).scroll(function() { $("div#report").html("<h3>Current: " + $(window).scrollTop() + "</h3>"); }); | ^ *\$\(window\)\.scroll\(function\(\) {\n *\$\(•div#.+•\)\.html\(•GeorgeStumph3LarryWellsCurrent: ?• \+ \$\(window\)\.scrollTop\(\) \+ •JudyOwens\/h3DennisLeadbetter•\);\n}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/qtkpL2gf/ | |||
http://jsfiddle.net/ASmarterWayToLearn/pyt2v54L/ |