I'd like a way to use the same script for multiple object because I have to replicate this for 50 times.
What the script does is that when you click on a button it should open a popup style image with a frame in it for every product with its gallery.
I'm currently using this :
<script>
$(document).ready(function(){
$("#popup").click(function(){
$("#overlay").fadeIn(500);
$("#overlay_div").fadeIn(500);
});
$("#close_botton").click(function(){
$("#overlay_div").fadeOut(500);
$("#overlay").fadeOut(500);
});
});
</script>
<script>
$(document).ready(function(){
$("#popup1").click(function(){
$("#overlay1" ).fadeIn(500);
$("#overlay_div1").fadeIn(500);
});
$("#close_botton1").click(function(){
$("#overlay_div1").fadeOut(500);
$("#overlay1").fadeOut(500);
});
});
</script>
<script>
$(document).ready(function(){
$("#popup2").click(function(){
$("#overlay2").fadeIn(500);
$("#overlay_div2").fadeIn(500);
});
$("#close_botton2").click(function(){
$("#overlay_div2").fadeOut(500);
$("#overlay2").fadeOut(500);
});
});
</script>
<div id="overlay"></div>
<div id="overlay_div">
<div id="close_botton">X</div>
<iframe src="galleria.html"; scrolling="auto" width="800px" height="700px">b</iframe>
</div>