TWB_Systems
asked on
How do I change the z-index by clicking anywhere other than on the element?
Here's what I am doing... I have an child element that has a z-index of -1 to begin with. Once the parent is clicked, it changes the z-index of the child to 9999 to give it the feel of a pop-up. Now when I click anywhere else on the page besides the parent or the child, I want the z-index of the child to go back to -1. Can anyone provide help with this?
Thanks,
TWB
Thanks,
TWB
ASKER
I'm doing Javascript, not JQuery.
<body onclick="changeZIndex()" >
</body>
function changeZIndex()
{
document.getElementById("p opup").sty le.zindex = -1;
}
</body>
function changeZIndex()
{
document.getElementById("p
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just added a div with 100% width and 100% height that was one less than the current popup that way when I click that, I can send the new div to the back and the popup to hidden.
$(body).click( function() {
$("#popup").css({ "z-index": -1});
});