Starr Duskk
asked on
Javascript CSS: click on left panel header opens right panel
I have a left panel of headers, that look like of like menu items. That is done.
I have a right panel. I want to be able to click on the left header and have a panel on the right appear.
If I click on another header, the panel on the right disappears and a different panel on the right appears, and so forth.
So how can I click a header on the left, and have it show the content on the right, and then another header hides all content on the right (not knowing what one was showing) and then shows the selected content on the right.
I don't want a slide out.
I looked at code and it shows panels where you click a plus symbol and the content within the same DIV group below it shows and hides. But I don't want it anywhere near each other on the page.
How do I do what I described?
thanks!
I have a right panel. I want to be able to click on the left header and have a panel on the right appear.
If I click on another header, the panel on the right disappears and a different panel on the right appears, and so forth.
So how can I click a header on the left, and have it show the content on the right, and then another header hides all content on the right (not knowing what one was showing) and then shows the selected content on the right.
I don't want a slide out.
I looked at code and it shows panels where you click a plus symbol and the content within the same DIV group below it shows and hides. But I don't want it anywhere near each other on the page.
How do I do what I described?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
leakim971,
This is perfect!!! I selected the vertical one and it is exactly what I need!
https://jqueryui.com/tabs/#vertical
thanks so much! I really don't understand what it is doing and can't see clearly how it is hiding and showing, I assume all that code is in the widget somewhere. I'll read more on that.
thanks so much!
This is perfect!!! I selected the vertical one and it is exactly what I need!
https://jqueryui.com/tabs/#vertical
thanks so much! I really don't understand what it is doing and can't see clearly how it is hiding and showing, I assume all that code is in the widget somewhere. I'll read more on that.
thanks so much!
ASKER
Julian, thanks for taking the time to respond as well.
You will probably need JavaScript for this. It is possible to have adjacent panels hide and show using a hidden checkbox and CSS but your layout might preclude such an arrangement which will leave you with JS.
A click event handler on the class of the left links can be used to hide all right panels and activate the one linked to the header clicked. You can use classes and custom attributes to link left to right so for instance
Left Links
Open in new window
Open in new window
jQueryOpen in new window
This is not working code - you would need to adapt to your specific requirement but it outlines the general principle.
If you can give us some indication as to how the right is going to work I can knock together a sample.