Ok, the title might sound a bit strange but i dont really know how to describe my problem in one sentence .
Im working on a little project where i have page where i can add dynamic divs and the dynamic div's include (.load) a html page with jquery.
Ill just show a sample code from what i have.
So a html page is loaded into a dynamic added div, code from the loaded html page:
Code:
<div id="container"> <!-- container -->
<div id="overlay">
<button id="clear-overlay">Clear</button>
</div>
<button id="show-overlay">Show</button> <
</div> <!-- end container-->
So i have a div.container with a div.overlay inside it, which is (like the id) a overlay (positioned on top with z-index) with a button to clear/hide the overlay.
Jquery code to hide (well fadeOut) the overlay which works like it should:
Code:
$("#clear-overlay").live("click",function(){
$(this).parent().fadeOut(1600);
});
But now i want to show(fadeIn) the overlay back again with the button inside the div.container and i have no clue how to do this.
Well i think (well maybe not) its something like (this).parent().children() or something but i cant figure it out and cant find any information on the web about it. And i cant use the id from the overlay div because it would show/fadeIn the overlays on all the added div's.
So im hoping this makes sense and someone here knows a solution for it, thnx in advance.
Last edited by TheSir; 06-22-2012 at 01:11 PM..
|