WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] using colorbox js without plugin (2 posts)

  1. jivyb
    Member
    Posted 3 years ago #

    I'm trying to use colorbox in wordpress in the same way that the demos
    are called on the colorbox website. The colorbox js file is getting
    included in the page fine but I get an error when I click on a link.
    Nothing happens and firebug says: $.data(this, colorbox) is undefined
    on line 189 and 208.
    I put this in my header.php:

    <script>
                    jQuery(document).ready(function($) {
                            $("a[rel='example1']").colorbox();
                    });
            </script>

    And the link code is:

    <p><a href="...
    2011/03/taziam-bio.png" rel="example1">Testing Lightbox</p>

    My test page is at http://bit.ly/fy6THV and the link is at the top and
    says "Testing Lightbox".

    I'm wanting to learn how to do this manually (w/out a plugin) so I can customize my site and learn more about jQuery and WordPress.

    Thanks!

  2. jivyb
    Member
    Posted 3 years ago #

    Ok, I got it (though I dont' have it running on the site right now. I thought I'd update in case someone else has the same problem). I thought I had disabled all wordpress plugins, but I forgot one (cleaner gallery), which was adding the extra class. Once I did that, there was no js conflict.

Topic Closed

This topic has been closed to new replies.

About this Topic