Jump to content

Jquery multiple populs


rx3mer

Recommended Posts

Hey guys,

 

I was just woundering what would be the best way of writing multiple popup functions? I can copy the code few times and change the ID but that doesen't sound efficeint.

<script type="text/javascript">
 
var popUpActive = false;
$(document).ready(function(){
//open popup
$("#pop").click(function(){
	if(popUpActive == false){
		$("#flyout").fadeIn(150, function(){
			popUpActive = true;
		});
	}
});

$(document).click(function(){
	if(popUpActive == true) $("#flyout").fadeOut(150, function(){
		popUpActive = false;
	});
});

});
</script>
Link to comment
https://forums.phpfreaks.com/topic/280565-jquery-multiple-populs/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.