Close popup on selection of content

Close popup on selection of content

I am trying to create a graphical image switcher.

Originally, I was using a dropdown list created in php to show about 150 image choices, when selected it would send the selected image to my image-switcher.php and change the displayed image. The problem was, with so many images and only a name to look at, it was frustrating my users.

So I created a popup with fancybox like so:

<script type="text/javascript">
$(document).ready(function()   
   {$("a.pop_up").fancybox
   ({"hideOnContentClick": true});});
</script>


I reworked the php to display thumbnails hrefed to the image-switcher. What I don't know how to do is have the fancybox popup close when a user either selects an image or hits x, right now they have to x-out after picking their image. Is there a trick to this, I thought the hideoncontentclick would do it?

Steve