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 measure the width including padding, border, and margin. | var elWidth = $("img#target").______ | outerWidth(true); | ^ *outerWidth\(true\); *$ |
Fill in the blank to measure the width including both padding and border but not the margin. | var elWidth = $("img#target").________ | outerWidth(); | ^ *outerWidth\(\); *$ |
Fill in the blank to measure the height including padding but not margin or border. | var elHeight = $("img#target")._____ | innerHeight(); | ^ *innerHeight\(\); *$ |
Fill in the blank to measure the height without padding, margin, or border. | var elHeight = $("img#target").____ | height(); | ^ *height\(\); *$ |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to measure the width including padding, border, and margin. | var total_width = $("div#info").outerWidth(true); | ||
Measure the width of $(this), without padding, margin, or border. Assign the number to the variable wThis. | var wThis = $(this).width(); | var`1spacewThis`1space=`1space$`(`this`)`.`width`(`)`; | |
Measure the height of a div whose id is "info". Include padding, margin, and border. Assign the number to hDiv. | var hDiv = $("div#info").outerHeight(true); | ||
Measure the width of a div including padding but not margin or border. Make up the div's id and the variable that stores the number. | var divW = $("div#products").innerWidth(); | ^ *var .+ = \$\(•div#.+•\)\.innerWidth\(\); *$ | |
Measure the height of an image including padding and border but not margin. Make up the image's id and the variable that stores the number. | var picH = $("img#loris").outerHeight(); | ^ *var .+ = \$\(•img#.+•\)\.outerHeight\(\); *$ | |
Measure the width of a div whose selector has been assigned to the variable dTarget. Include the padding, border, and margin. Make up the variable that stores the number. | var divW = dTarget.outerWidth(true); | ^ *var .+ = dTarget\.outerWidth\(true\); *$ | |
Measure the width of a div including the padding and border but not the margin. Make up the div's id and the variable that stores the number. | var divW = $("div#comments").outerWidth(); | ^ *var .+ = \$\(•div#.+•\)\.outerWidth\(\); *$ | |
Measure the width of a div without padding, border, and margin. Measure the height with padding, border, and margin. Make up the div's id and the variable names. | var dWidth = $("div#extra").width(); var dHeight = $("div#extra").outerHeight(true); | ^ *var .+ = \$\(•div#(.+)•\)\.width\(\);\n *var .+ = \$\(•div#\1•\)\.outerHeight\(true\); *$ | |
Measure the height of a div whose id is "info". Include padding, margin, and border. Assign the number to hDiv. | var hDiv = $("div#info").outerHeight(true); | ^ *var hDiv = \$\(•div#info•\)\.outerHeight\(true\); *$ | |
Measure the width of a div including padding but not margin or border. Make up the div's id and the variable that stores the number. | var divW = $("div#products").innerWidth(); | ^ *var .+ = \$\(•div#.+•\)\.innerWidth\(\); *$ | |
Measure the height of an image including padding and border but not margin. Make up the image's id and the variable that stores the number. | var picH = $("img#loris").outerHeight(); | ^ *var .+ = \$\(•img#.+•\)\.outerHeight\(\); *$ | |
Measure the width of a div whose selector has been assigned to the variable dTarget. Include the padding, border, and margin. Make up the variable that stores the number. | var divW = dTarget.outerWidth(true); | ^ *var .+ = dTarget\.outerWidth\(true\); *$ | |
Measure the width of a div including the padding and border but not the margin. Make up the div's id and the variable that stores the number. | var divW = $("div#comments").outerWidth(); | ^ *var .+ = \$\(•div#.+•\)\.outerWidth\(\); *$ | |
Measure the width of a div without padding, border, and margin. Measure the height with padding, border, and margin. Make up the div's id and the variable names. | var dWidth = $("div#extra").width(); var dHeight = $("div#extra").outerHeight(true); | ^ *var .+ = \$\(•div#(.+)•\)\.width\(\);\n *var .+ = \$\(•div#\1•\)\.outerHeight\(true\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/jkcvnw4v/ | |||
http://jsfiddle.net/ASmarterWayToLearn/pqfaps4p/ |