WordPress.org

Ready to get started?Download WordPress

Forums

jQuery Colorbox
Reinitiating Colorbox when ajax content is loaded. (2 posts)

  1. thelingokid
    Member
    Posted 2 years ago #

    The theme I am using loads content into a div via ajax/jquery, here is a link to the site, http://d53513.u29.emggroup.info/

    I have colorbox working on the initial load of a page, if you click on the video thumbnail it opens the youtube video in he colorbox, however if you click on the "Allergy & Sinus" category link in the right side bar then click on the video thumbnail, colorbox isn't working because the cboxElement class is not being applied to the newly loaded content.

    How can I reinitialize the colorbox jQuery action that appends the cboxElement class to the link and make this function properly?

    Can I add a function to using the .ajaxComplete function when the content finishes loading.

    http://wordpress.org/extend/plugins/jquery-colorbox/

  2. thelingokid
    Member
    Posted 2 years ago #

    The answer....

    add the following to the function that loads in the new content, very last item (colorboxSelector();) see below.

    $mainContent.load(URL, function() {
        $ajaxSpinner.fadeOut();
        $mainContent.animate({ opacity: "1" });
    	colorboxSelector();
    });

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic