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 truncate the paragraph to 4em. | p.short { ____________ overflow: hidden; } | height: 4em; | ^ *height: 4em; *$ |
Fill in the blank to hide the overflow. | p.short { height: 4em; ____________ } | overflow: hidden; | ^ *overflow: hidden; *$ |
Fill in the blank to allow the paragraph to display at full height. | p.full_height { ____________ } | height: auto; | ^ *height: auto; *$ |
Code the jQuery selector that selects this link: | <a href="javascript:void(0)" id="show_more"> | $("a#show_more") | ^ *\$\(•a#show_more•\) *$ |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to code a link that doesn't link to anything. | <a href="javascript:void(0)" id="show_more">Show more</a> | ||
Code the CSS line that hides overflow. Don't indent it. | overflow: hidden; | overflow`:`1spacehidden`; | |
Code the CSS line that allows a paragraph to display at full height. Don't indent it. | height: auto; | ||
Select a link. Make up its id. | $("a#loris") | ^ *\$\(•a#.+•\) *$ | |
Add a class to a paragraph. Make up the paragraph's id and the class name. | $("p#loris").addClass("fullHeight"); | ^ *\$\(•p#.+•\)\.addClass\(•.+•\); *$ | |
Code four lines that limit the length that a class of paragraph displays. Make up the class name and the number of ems. | p.short { height: 4em; overflow: hidden; } | ^ *p\..+ {\n *height: [0-9]+em;\n *overflow: hidden;\n *} *$ | |
Code three lines that allow paragraphs of a certain class to display full-length. Make up the class name. | p.full { height: auto; } | ^ *p..+ {\n *height: auto;\n *} *$ | |
When the user clicks a link, a class is added to a paragraph. Make up the link id, paragraph id, and class name. | $("a#loris").on("click", function() { $("p#more_loris").addClass("full_length"); }); | ^ *\$\(•a#.+•\)\.on\(•click•, function\(\) {\n *\$\(•p#.+•\)\.addClass\(•.+•\);\n *}\); *$ | |
Code the CSS line that allows a paragraph to display at full height. Don't indent it. | height: auto; | ^ *height: auto; *$ | |
Select a link. Make up its id. | $("a#loris") | ^ *\$\(•a#.+•\) *$ | |
Add a class to a paragraph. Make up the paragraph's id and the class name. | $("p#loris").addClass("fullHeight"); | ^ *\$\(•p#.+•\)\.addClass\(•.+•\); *$ | |
Code four lines that limit the length that a class of paragraph displays. Make up the class name and the number of ems. | p.short { height: 4em; overflow: hidden; } | ^ *p\..+ {\n *height: [0-9]+em;\n *overflow: hidden;\n *} *$ | |
Code three lines that allow paragraphs of a certain class to display full-length. Make up the class name. | p.full { height: auto; } | ^ *p..+ {\n *height: auto;\n *} *$ | |
When the user clicks a link, a class is added to a paragraph. Make up the link id, paragraph id, and class name. | $("a#loris").on("click", function() { $("p#more_loris").addClass("full_length"); }); | ^ *\$\(•a#.+•\)\.on\(•click•, function\(\) {\n *\$\(•p#.+•\)\.addClass\(•.+•\);\n *}\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/ocz07Ltm/ | |||
http://jsfiddle.net/ASmarterWayToLearn/nc0xebpm/ |