Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:51:06+00:00 2026-06-07T09:51:06+00:00

I m using shadowbox.js for image gallery display. for this we have to generate

  • 0

I m using shadowbox.js for image gallery display.

for this we have to generate html like this

<a href="images/Ganesha3602.jpg" rel="shadowbox[my]"><img src="images/thumb.jpg"   alt="First" title="First image" /></a>
<a href="images/original.jpg" rel="shadow[my]"><img src="images/thumb.jpg" alt="Second" title="Second image" /></a>
<a href="images/original.jpg" rel="shadowbox[my]"><img src="images/thumb.jpg" alt="First" title="First image" /></a>

and then apply Shadowbox.init() on body load. Its working like a charm when the above html is static. But when i generate it dynamically using $.ajax and call Shadowbox.init() on success; shadowbox does not work. I also tried calling Shadowbox.init() on complete.

My code is something like this:

$(document).on('click','#load_posts_comments',function(){

    $.ajax({
        url:"post_comment_json.php",
        type: "POST",
        dataType: "json",
        data:{user_id:"123"},
        success: function(data){
            load_posts_comments(data);
        },
        complete: function(){
            Shadowbox.init();
        }
    });
});

Where am I going wrong? I looked the shadowbox website but there was no documentation regarding dynamically loaded content. Help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:51:07+00:00Added an answer on June 7, 2026 at 9:51 am

    You need to reinitialize it by using Shadowbox.clearCache(); and Shadowbox.setup();.
    It’s been explained much better here: shadowbox stops working after jquery function call

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My final code looks like this: <a href=/galleries/hairtinsels/hairtinsel/hairtinsels.jpg rel=shadowbox[gallery] title=Hair Tinsels, 24 Colour Choices,
I'm trying to create an image gallery using Shadowbox plugin(http://www.shadowbox-js.com). So I got a
I'm currently using Shadowbox.js to my gallery and I want to disable the right
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
I'm using a shadowbox which generates an iframe to display product details on a
Has anyone come across this before and know a solution? I'm using Shadowbox to
I'm using shadowbox for some html/iframe links, which effectively opens up the page in
Im building a site which opens Youtube videos onsite using Shadowbox. I have found
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
HTML: <table border=1px> <tr> <td colspan=2> <div class=commentLink> <a onclick=ShowBox.call(this); return false; href=#>Comment</a> </div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.