Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
CSS Showcase: Content-Visibility
- Loading branch information
Showing
4 changed files
with
282 additions
and
38 deletions.
There are no files selected for viewing
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Declare Button Variables | ||
const displayButton = document.querySelector('#display-text'); | ||
const visibilityButton = document.querySelector('#visibility-text'); | ||
const contentButton = document.querySelector('#content-text'); | ||
const resetButton = document.querySelector('#reset'); | ||
|
||
const dispExpDiv = document.querySelector('#disp-exp-div'); | ||
const visExpDiv = document.querySelector('#vis-exp-div'); | ||
const contExpDiv = document.querySelector('#cont-exp-div'); | ||
|
||
const middlePic = document.querySelector('#visibility-image'); | ||
|
||
//--------------------------------------------------------------- | ||
|
||
// Change css for each button attribute | ||
displayButton.onclick = function disp() { | ||
middlePic.style.display = "none"; | ||
dispExpDiv.style.display = "block"; | ||
visibilityButton.style.display = "none"; | ||
contentButton.style.display = "none"; | ||
} | ||
|
||
visibilityButton.onclick = function vis() { | ||
middlePic.style.visibility = "hidden"; | ||
visExpDiv.style.display = "block"; | ||
displayButton.style.display = "none"; | ||
contentButton.style.display = "none"; | ||
} | ||
|
||
contentButton.onclick = function cont(){ | ||
middlePic.style.contentVisibility = "hidden"; | ||
contExpDiv.style.display = "block"; | ||
displayButton.style.display = "none"; | ||
visibilityButton.style.display = "none"; | ||
} | ||
|
||
resetButton.onclick = function reset(){ | ||
middlePic.style.contentVisibility = "visible"; | ||
middlePic.style.visibility = "visible"; | ||
middlePic.style.display = "block"; | ||
contExpDiv.style.display = "none"; | ||
visExpDiv.style.display = "none"; | ||
dispExpDiv.style.display = "none"; | ||
displayButton.style.display = "block"; | ||
visibilityButton.style.display = "block"; | ||
contentButton.style.display = "block"; | ||
} | ||
|
||
//--------------------------------------------------------------- | ||
|
||
const browserButton = document.querySelector('#browser-show-div'); | ||
const browserList = document.querySelector('#browser-div'); | ||
|
||
browserButton.onclick = function browser() { | ||
if (browserList.style.display === "none") | ||
browserList.style.display = "block" | ||
else { | ||
browserList.style.display = "none"; | ||
} | ||
} |