On my webpage, I have two div banners with corresponding CSS arrows. Clicking the banners triggers a JavaScript function that toggles between revealing and hiding the text below them. As the text is revealed, the arrows rotate downward and rotate back up when hidden.
My challenge is that I want the first div banner to be automatically revealed when the page loads. However, due to the padding in the div, aligning the arrow perfectly with subsequent divs has been difficult.
You can see an example of this issue here: http://jsfiddle.net/nVuQ2/1/
I've attempted adjusting the placement of the arrow using CSS:
.tri0 {
margin-left: 20px;
margin-top: 5px;
}
However, I've only managed to move the tri0
arrow up to the padding of the h3
tag without further progress. Is there a way to set a toggle flag within the toggleClass function to indicate that the first div banner is already toggled, so subsequent clicks will untoggle it?