Multiple popups
Multiple popups
I'm trying to open multiple popups from multiple links:
-
<a href="#" class="popup">Link 1</a>
<a href="#" class="popup">Link 2</a>
<div id="popupContact"> Content 1 </div>
<div id="popupContact"> Content 2 </div>
So link 1 should open content 1, link2-> content2 and so on (they are php-generated).
This is the code so far; it works with a single popup:
-
$("#schedasx a.popup").click(function(){
//load popup
loadPopup();
});
function loadPopup(){
$("#backgroundPopup").css({
"opacity": "0.7"
$("#backgroundPopup").fadeIn("slow");
$("#popupContact").fadeIn("slow");
}
}
How do I extend this to multiple popups? I tried with index, with not much luck.
Thank you