views:

384

answers:

1

I am getting "is null" errors on a jQuery fancybox install here

Here is the jquery:

    <script type="text/javascript">
    $(document).ready(function() {
        $("a.video").fancybox({
            'zoomOpacity'           : true,
            'overlayShow'           : false,
            'zoomSpeedIn'           : 500,
            'zoomSpeedOut'          : 500
        });
    });
</script>

Here is the html portion:

<a class="video" href="#testube"><img src="images/video.jpg" alt="Idea People Video" /></a>

<div style="display:none" id="testube">
        <object width="560" height="340">
            <param name="movie" value="http://www.youtube.com/v/9VUhmErOxwk&amp;hl=en_US&amp;fs=1&amp;rel=0"&gt;&lt;/param&gt;
            <param name="allowFullScreen" value="true"></param>
            <param name="allowscriptaccess" value="always"></param>
            <embed src="http://www.youtube.com/v/9VUhmErOxwk&amp;hl=en_US&amp;fs=1&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed>
        </object>
</div>

Would appreciate some help figuring out why I get the error and no popup video.

Thanks.

+2  A: 

You have a conflict with $ on the page since prototype is being included on the page as well, this will work since $ is taken over by prototype:

jQuery(function() {
    jQuery("a.video").fancybox({
        'zoomOpacity'           : true,
        'overlayShow'           : false,
        'zoomSpeedIn'           : 500,
        'zoomSpeedOut'          : 500
    });
});
Nick Craver
Hi Nick, I made the change but it still does not work properly. Any clues? Thanks.
fmz
@fmz: I updated the above (though the previous worked for me, at least in FF 3.6)...try that code, it now replaces all $ references.
Nick Craver
Hi Nick. Alas no go. I am going to try a Prototype version to see if I can avoid the conflict - it is always more complex to fix someone else 's code. Thanks for the help. I'll follow up after I get it going.
fmz