Product Strategist, Experience Designer & Code Tweaker 

Facebook Twitter LinkedIn
 
 
Home » Code is Poetry » How to show a Div & hide the rest, simultaneously
formats

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.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Muthukumar Rajamani
credit