forrest
forrest

Reputation: 10972

jQuery Fancybox - funny errors and no popup window

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&hl=en_US&fs=1&rel=0"></param>
            <param name="allowFullScreen" value="true"></param>
            <param name="allowscriptaccess" value="always"></param>
            <embed src="http://www.youtube.com/v/9VUhmErOxwk&hl=en_US&fs=1&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.

Upvotes: 2

Views: 1517

Answers (1)

Nick Craver
Nick Craver

Reputation: 630389

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
    });
});

Upvotes: 2

Related Questions