-
-
Save brian-griffin/4046111 to your computer and use it in GitHub Desktop.
We want to add a z-index of 1 to a container_div, but only if it contains a target_widget (we can't add z-index:1 to all container_div's)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container_div"> | |
<div class="target_widget"></div> | |
</div> | |
<div class="container_div"> | |
<div class="non_target"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.target_widget').closest('.container_div').css('z-index','1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We want to add a z-index of 1 to a container_div, but only if it contains a target_widget (we can't add z-index:1 to all container_div's).
We would prefer a css solution, but at present there is no known way of adding styling to a parent element from its child without using JavaScript/jQuery,