I need Fancybox to close when the user clicks a link inside fancybox.
I tried:
href="javascript:$j.fn.fancybox.close();"
(note that I'm using jQuery without conflict, therefore, $ j) `
When I try, it does not work, and I get an error in Firebug that says $j.fn.fancybox.close is not a function.
Note. I am using Fancybox version 1.3.4
Here is the Fancybox script:
<script type="text/javascript" > var $j = jQuery.noConflict(); $j(document).ready(function(){ $j("#start").fancybox({ 'padding' : 0 }); </script>
HTML code for Fancybox:
<div class="hide"> <img src="/Images/skin/spacer1x1.png" onload="$j('#start').trigger('click');" /> <a href="#welcome" id="start"></a> <img style="width:700px; height:600px;" id="welcome" usemap="#Map" alt="PLEASE VIEW PAGE WITH IMAGES ON" src="/Images/start/start.png" /> <map id="Map" name="Map"> <area alt="See Message Examples" href="/artistphotos/" coords="29,431,301,465" shape="rect" /> <area alt="Enter Site" href="javascript:$j.fn.fancybox.close();" coords="436,433,567,464" shape="rect" /> </map> </div>
Any ideas how to make this work correctly?
source share