views:

975

answers:

1

I'm using fancybox to load up some inline content on a web page.

Fancybox loads up fine as do the images, the only problem is that I would like certain jquery functions to work within the modal window which will not load up.

The jquery functions work fine when I load them outside of fancybox so was wondering if anyone knows how to call these functions when the window is open?

EDIT

so i have tried the callbackonshow but cannot get it to work, what am i doing wrong here?

    <script type="text/javascript">
    jQuery(document).ready(function($) {

    function hover() {
    $("#container ul#thumbnails li a").hover(
     function(){

      var largePath = $(this).attr("name");

      $("#container #main_image img#largeId").attr({ src: largePath }); return false);
    }

    $("a.group").fancybox({
              'frameWidth': 966,
        'frameHeight': 547,
        'hideOnContentClick': false,
        'callbackOnShow': hover
        });

   });
   </script>
+1  A: 

You probably just need to use the callbackOnShow option to pass in a function.

It's outlined here: Fancy Box

Brandon Joyce

Brandon Joyce
that seems to be the right direction but i cannot get me function to load - see above if you can help!
DanC
try just replacing hover with function() { alert("test"); }That will tell you if it's executing it or not.
Brandon Joyce