I have a problem with clicking the event on different modal devices.
I have a modal div 'A' which shows an overlay divisement with some information, this div is shown by clicking a button. Therefore, when it is shown that I click outside the overlapped diva, I want to close it.
I have another div 'b', which shows an overlay div, some other information is shown by clicking on this div one button b So, when it is shown that I click outside the overlapped diva, I want to close it.
In both cases, I use $ (window). To manage them.
The question is that once I click on the 'A' button, the div related to it comes and if I click on 'B' then I should close 'A' And div 'B' come up and do visevarsa.
How do I manage multiple click events for many modal devices?
Thank you. Y
I'm not sure this is what you want but ...
Believing its buttons and divisions is in the form of "overlay", and has the id as Rolando's example ("Butt", "Diva", "Button B", "Dibb" etc.).
$ (".layerlay"). (": button"). Click (function () {var callid = / button (. +) /. Exec ($ () .attr ("id")) [1]; $ ("div.overlay [id $ =" + Callid + " ] "). $ (" Div.overlay: not ([id $ = "+ callid +"]) "). Hide ();}) Example:
The only issue is that "click it outside the div to close it" section; I tried to use the $ (": not (.overlay)"). Click (function () {$ ("div.overlay"). Hide ()} , but do not think it works because you have hidden div that you clicked is.
Comments
Post a Comment