I’m using jqUI to build an app with a content pane and side-menu.
When the page is showing the list, I want to hide some of the menu content, but when the page is showing an item, I want to show the menu content.
I’ve created a pretty basic jsfiddle as an example http://jsfiddle.net/pq83M/8/
I DON’T want to do this in javascript, as the page transitions are in the jqui library and I don’t think it’s effective to listen for this specific transition separately fro the others.
What I am hoping to figure out is a way of saying
when
div#content > div#list_item.active ~ div#menu > div#list_item_details {
display:block;
}
with the caveat that the ~ is looking for the sibling of div#content, not the sibling of div#list_item.active.
I’m using Sass, so those custom selectors are available.
If I understand your question correctly, you want to find siblings based on the parent (
div#content) but only start with particular parents depending on their children (div#list_item.active).If so, it’s not possible in CSS Selector Level 3, but it’s coming in CSS Selectors Level 4; you’ll be able to select the subject of your operation/comparison. http://dev.w3.org/csswg/selectors4/#subject