Is there a way to toggle the visibility of one DIV by clicking on another, while hiding the previously active DIV?
I attempted to use JQuery's slideUp() and slideDown() methods with no success.
Here is the JSFiddle I am currently experimenting with: https://jsfiddle.net/wLayxqq2/
My goal is to display content associated with different colors!
I have come across similar JSFiddles that demonstrate showing and hiding content from individual divs, but none that address hiding content from the previously "active" div!
HTML Code:
<div class="option">Red</div>
<div class="option">Yellow</div>
<div class="option">Green</div>
<div id="red" class="colors"> This is content for red </div>
<div id="yellow" class="colors"> This is content for Yellow </div>
<div id="blue" class="colors"> This is content for Green </div>
CSS Code:
.option{
display:inline-block;
border: solid 1px;
margin:5px;
padding:5px;
}