Created
February 27, 2017 01:59
-
-
Save cmoscardi/1646d4b88434597ee7245187fe776698 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=1646d4b88434597ee7245187fe776698
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<div class="part2"> | |
<div class="boxes"> | |
<div class="box" id="box1">1</div> | |
<div class="box" id="box2">2</div> | |
</div> | |
<div class="box-controls"> | |
<input id="box-number" placeholder="enter box #"/> | |
<button id="hide-button">HIDE</button> | |
<button id="show-button">SHOW</button> | |
<button id="add-button">ADD</button> | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"enabledLibraries":["jquery"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#hide-button").click(function(){ | |
var number = $("#box-number").val(); | |
$("#box"+number).hide(); | |
}); | |
$("#show-button").click(function(){ | |
var number = $("#box-number").val(); | |
$("#box"+number).show(); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#full-name { | |
border: 1px solid black; | |
height: 30px; | |
} | |
.part2 { | |
margin-top: 50px; | |
} | |
.box-controls { | |
display: flex; | |
justify-content: center; | |
} | |
.boxes { | |
display: flex; | |
justify-content: center; | |
} | |
.box { | |
width: 100px; | |
height: 100px; | |
margin: 10px; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
color: white; | |
font-size: 40px; | |
font-family: arial; | |
background-color: red; | |
} | |
#box1 { | |
background-color: goldenrod; | |
} | |
#box2 { | |
background-color: skyblue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment