Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  35] [ 7]  / answers: 1 / hits: 21760  / 13 Years ago, thu, august 25, 2011, 12:00:00

OK, So i have this snippet http://jsfiddle.net/8vFEd/ here;



whenever the popup comes up, I either want to disable the background, so that users can't click on another language until they close the first popup, or how would I accomplish that, whenever users click on second language, the first popup disappears and its corresponding popup appears.


More From » jquery

 Answers
15

My suggestion would be to put an overlay over the background which will catch clicks through to the rest of the page. Add the following to your $('.prop a').click() function, before the <div class='lang'> append call:



$(body).append('<div class=modalOverlay>');


and this to your css:



.modalOverlay {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background-color: rgba(0,0,0,0.3); /* black semi-transparent */
}


Then in your code for handling close clicks, remove this .modalOverlay from the DOM. Remember to add the overlay before your popup window so it sits behind the window (or add z-index: 5 to your overlay css and z-index: 6 to your popup css)



I would also suggest modifying your .lang css rule to be position: absolute; or fixed instead of relative.


[#90427] Wednesday, August 24, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stephonkeandrer

Total Points: 392
Total Questions: 94
Total Answers: 100

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
;