add some additional jquery challenges

This commit is contained in:
Quincy Larson
2015-06-27 19:42:25 -07:00
parent 7ee4b22a57
commit 05cfe86cd0

View File

@ -18,6 +18,8 @@
"assert(editor.match(/\\n\\s+?\\}\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>\\}\\);</code>.')" "assert(editor.match(/\\n\\s+?\\}\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>\\}\\);</code>.')"
], ],
"challengeSeed": [ "challengeSeed": [
"",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -65,6 +67,7 @@
"", "",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -112,6 +115,7 @@
" $('img').addClass('animated bounce');", " $('img').addClass('animated bounce');",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -159,6 +163,7 @@
" $('.btn').addClass('animated shake');", " $('.btn').addClass('animated shake');",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -207,6 +212,7 @@
" $('.btn').addClass('animated shake');", " $('.btn').addClass('animated shake');",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -256,6 +262,7 @@
" $('#cat-photo-form').addClass('animated pulse');", " $('#cat-photo-form').addClass('animated pulse');",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -303,6 +310,7 @@
" $('#cat-photo-form').css('background-color', 'gray');", " $('#cat-photo-form').css('background-color', 'gray');",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -351,6 +359,7 @@
" $('#submit-button').prop('disabled', 'true');", " $('#submit-button').prop('disabled', 'true');",
" });", " });",
"fcces", "fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<br>", "<br>",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>", "<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>", "<br>",
@ -382,48 +391,41 @@
{ {
"id": "bad87fee1348bd9aed608826", "id": "bad87fee1348bd9aed608826",
"name": "Waypoint: Move an Element Using jQuery", "name": "Waypoint: Use appendTo to Move Elements with jQuery",
"dashedName": "waypoint-move-an-element-using-jquery", "dashedName": "waypoint-use-appendto-to-move-elements-with-jquery",
"difficulty": 0.079, "difficulty": 0.079,
"description": [ "description": [
"$('.btn').appendTo('#right-well')"
], ],
"tests": [ "tests": [
"assert($('#left-well').children().length === 0, 'Your left well should not have any buttons inside it.')",
"assert($('#right-well').children().length === 6, 'Your right well should have all 6 buttons inside it.')"
], ],
"challengeSeed": [ "challengeSeed": [
"fccss", "fccss",
" $(document).ready(function() {", " $(document).ready(function() {",
" $('#cat-photo-form').css('background-color', 'gray');", "",
" $('#submit-button').prop('disabled', 'true');",
" $('img').remove();",
" });", " });",
"fcces", "fcces",
"<br>", "<!-- You shouldn't need to modify code below this line -->",
"<img src='http://bit.ly/fcc-kittens2' class='img-responsive'>",
"<br>",
"<div class='row'>", "<div class='row'>",
" <div class='col-xs-4'>", " <div class='col-xs-6'>",
" <button class='btn btn-block btn-primary'><i class='fa fa-thumbs-up'></i> Like</button>", " <h4>#left-well</h4>",
" </div>", " <div class='well' id='left-well'>",
" <div class='col-xs-4'>", " <button class='btn btn-default target' id='target1'>#target1</button>",
" <button class='btn btn-block btn-info'><i class='fa fa-info-circle'></i> Info</button>", " <button class='btn btn-default target' id='target2'>#target2</button>",
" </div>", " <button class='btn btn-default target' id='target3'>#target3</button>",
" <div class='col-xs-4'>",
" <button class='btn btn-block btn-danger'><i class='fa fa-trash'></i> Delete</button>",
" </div>", " </div>",
" </div>", " </div>",
"<br>", " <div class='col-xs-6'>",
"<form action='submit-cat-photo' id='cat-photo-form'>", " <h4>#right-well</h4>",
" <div class='row'>", " <div class='well' id='right-well'>",
" <div class='col-xs-7'>", " <button class='btn btn-default target' id='target4'>#target4</button>",
" <input type='text' class='form-control' placeholder='cat photo URL' required>", " <button class='btn btn-default target' id='target5'>#target5</button>",
" </div>", " <button class='btn btn-default target' id='target6'>#target6</button>",
" <div class='col-xs-5'>",
" <button type='submit' id='submit-button' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>",
" </div>", " </div>",
" </div>", " </div>",
"</form>" "</div>"
], ],
"challengeType": 0 "challengeType": 0
}, },
@ -434,13 +436,36 @@
"dashedName": "waypoint-clone-an-element-using-jquery", "dashedName": "waypoint-clone-an-element-using-jquery",
"difficulty": 0.080, "difficulty": 0.080,
"description": [ "description": [
"Clone the #target1 element and append it to the #left-well element. $('#target1').clone().appendTo('#left-well')"
], ],
"tests": [ "tests": [
"assert($('#left-well').children().length > 3, 'You should have at least 4 button elements in your #left-well element')"
], ],
"challengeSeed": [ "challengeSeed": [
"fccss",
" $(document).ready(function() {",
"",
" });",
"fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<div class='row'>",
" <div class='col-xs-6'>",
" <h4>#left-well</h4>",
" <div class='well' id='left-well'>",
" <button class='btn btn-default target' id='target1'>#target1</button>",
" <button class='btn btn-default target' id='target2'>#target2</button>",
" <button class='btn btn-default target' id='target3'>#target3</button>",
" </div>",
" </div>",
" <div class='col-xs-6'>",
" <h4>#right-well</h4>",
" <div class='well' id='right-well'>",
" <button class='btn btn-default target' id='target4'>#target4</button>",
" <button class='btn btn-default target' id='target5'>#target5</button>",
" <button class='btn btn-default target' id='target6'>#target6</button>",
" </div>",
" </div>",
"</div>"
], ],
"challengeType": 0 "challengeType": 0
}, },
@ -451,13 +476,37 @@
"dashedName": "waypoint-target-the-parent-of-an-element-using-jquery", "dashedName": "waypoint-target-the-parent-of-an-element-using-jquery",
"difficulty": 0.082, "difficulty": 0.082,
"description": [ "description": [
"Change the parent of the #target1 element to have the background color of red.",
"$('#target1').parent().css('background-color', 'red')"
], ],
"tests": [ "tests": [
], ],
"challengeSeed": [ "challengeSeed": [
"fccss",
" $(document).ready(function() {",
"",
" });",
"fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<div class='row'>",
" <div class='col-xs-6'>",
" <h4>#left-well</h4>",
" <div class='well' id='left-well'>",
" <button class='btn btn-default target' id='target1'>#target1</button>",
" <button class='btn btn-default target' id='target2'>#target2</button>",
" <button class='btn btn-default target' id='target3'>#target3</button>",
" </div>",
" </div>",
" <div class='col-xs-6'>",
" <h4>#right-well</h4>",
" <div class='well' id='right-well'>",
" <button class='btn btn-default target' id='target4'>#target4</button>",
" <button class='btn btn-default target' id='target5'>#target5</button>",
" <button class='btn btn-default target' id='target6'>#target6</button>",
" </div>",
" </div>",
"</div>"
], ],
"challengeType": 0 "challengeType": 0
}, },
@ -468,13 +517,37 @@
"dashedName": "waypoint-target-the-children-of-an-element-using-jquery", "dashedName": "waypoint-target-the-children-of-an-element-using-jquery",
"difficulty": 0.083, "difficulty": 0.083,
"description": [ "description": [
"Change the color of all the #left-well element's children to blue.",
"$('#right-well').children().css('background-color', 'blue')"
], ],
"tests": [ "tests": [
], ],
"challengeSeed": [ "challengeSeed": [
"fccss",
" $(document).ready(function() {",
"",
" });",
"fcces",
"<!-- You shouldn't need to modify code below this line -->",
"<div class='row'>",
" <div class='col-xs-6'>",
" <h4>#left-well</h4>",
" <div class='well' id='left-well'>",
" <button class='btn btn-default target' id='target1'>#target1</button>",
" <button class='btn btn-default target' id='target2'>#target2</button>",
" <button class='btn btn-default target' id='target3'>#target3</button>",
" </div>",
" </div>",
" <div class='col-xs-6'>",
" <h4>#right-well</h4>",
" <div class='well' id='right-well'>",
" <button class='btn btn-default target' id='target4'>#target4</button>",
" <button class='btn btn-default target' id='target5'>#target5</button>",
" <button class='btn btn-default target' id='target6'>#target6</button>",
" </div>",
" </div>",
"</div>"
], ],
"challengeType": 0 "challengeType": 0
}, },