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

  1. thelingokid
    Posted 4 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.


  2. thelingokid
    Posted 4 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() {
        $mainContent.animate({ opacity: "1" });

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • jQuery Colorbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic