in Code is Poetry

How to show a Div & hide the rest, simultaneously

Encountered an interesting issue while working on the “Accordion Menu”

Problem : Multiple Divs get thrown up, when multiple links get clicked. The hierarchy of these Divs is determined by the Z-index. Divs with lower Z-index value, get hidden behind Divs with higher Z-index value. Either the navigation has to be “Modal/ Hub & Spoke” ( close a open-Div, before clicking on another link) or the THE INTERFACE needs to close a ‘previously shown Div’ and simultaneously show a relevant Div, whenever a link gets clicked. And How?

Solution : Realized that by default, all secondary Divs (ones on the east) need to be hidden.

Also realized that multiple JavaScript functions can be called simultaneously, from a link. All you need to do is separate them with a semi-colon ” ;”

javascript : HideAllDivsOnTheEast() ; ShowOnlyTheRelevantDiv()

While i do have a working example, its not yet time to go Open.

Written By:

Add a Comment