Added dirocty from javascript to jquery
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//wait until page is ready
|
||||
$(document).ready(function() {
|
||||
//sets <a> element within paragraph to yellow
|
||||
$("p").click(function(){
|
||||
$(this).children("a").css("background-color", "yellow"); /* returns all the <a> child elements that are
|
||||
within this paragraph*/
|
||||
});
|
||||
|
||||
// Toggle the visibility of the paragraph when a button is clicked
|
||||
$("button").click(function(){
|
||||
$(this).prev().slideToggle('slow');
|
||||
});
|
||||
|
||||
// Open the paragraph once the image is clicked
|
||||
$("img").click(function() {
|
||||
$(this).next().children("p").slideDown();
|
||||
});
|
||||
|
||||
$(".card").click(function() {
|
||||
$(this).toggleClass("highlight");
|
||||
});
|
||||
|
||||
// All cards that are not currently selected will be hidden when `select_btn` is clicked
|
||||
$("#select_btn").click(function() {
|
||||
$(".card:not(.highlight)").hide();
|
||||
});
|
||||
|
||||
// Select all cards
|
||||
$("#all_btn").click(function(){
|
||||
$(".card").show();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user