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

  • SEARCH
  • Home
  • 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 6628779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:09:57+00:00 2026-05-25T22:09:57+00:00

Note: I have used lightbox and its many alternatives in an attempt to fix

  • 0

Note: I have used lightbox and its many alternatives in an attempt to fix this and im using clearbox at the moment.

The Problem: Currently i have javascript code that depending on the element that is clicked, the modal popup of the lightbox should show the user a different set of images. Below is the code I am currently modifying.

$("download").html(" \
<span style='color:white'> \
    <a href='img/26.jpg' rel='clearbox' title='Caption'>View Screenshots</a> \
</span><br /> \

However the link does not initiate the lightbox (works on links already on the page) and i have spent two days looking through google and stackoverflow trying to find a fix.

Outline of what I am trying to achieve: A Showcase of my work where one image will be dynamically added through javascript as a hyperlink depending on the work chosen. When the user clicks it will allow them to go through all the other images that are hidden but part of the gallery. There will be multiple galleries. Thank you for reading.

Edit 1: Please excuse the mspaint job
https://i.stack.imgur.com/rN8q1.jpg

  • 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-05-25T22:09:58+00:00Added an answer on May 25, 2026 at 10:09 pm

    The issue is that you have to call clearbox on any links that are pulled into the page via ajax. When you call clearbox initially, jQuery grabs all of the elements from your selector and adds the functionality to them. If you then, pull in additional links via ajax (or even add them to the dom later), then clearbox has not been instantiated for those elements.

    The jQuery .live() function fixes this for elements added to the dom, but clearbox is not built to use .live(). Therefore, you’ll have to call clearbox on any additional links that are added to the page separately.

    http://api.jquery.com/live/


    EDIT
    I’ve had a quick look at the clearbox doc page: http://www.clearbox.hu/index_en.html

    It states that you can call CB_Init() to add clearbox to new items:

    Using the script with AJAX
    If you load new content with AJAX in your
    webpage without refreshing it and you want, that the clearbox work
    with the new content too, you have to call CB_Init(); function AFTER
    your AJAX content-load.

    So you can just do this:

    $("download").html(" \
            <span style='color:white'> \
               <a href='img/26.jpg' rel='clearbox' title='Caption'>View Screenshots</a> \
            </span><br /> \ ");
    CB_Init();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NOTE: I have solved the majority of this problem but have run into a
i have a recursive query like this (note: this is just an example): var
I have used the signalR chat app (as laid out in this tutorial http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
I am using Carrierwave to upload the imgae, i have used in one model,
In the past, I have used Vim as a note taking platform by creating
I am developing an application using MVC Preview 5. I have used typed views.
I have used the following code. This code works sometime but sometime not works.
I am making a paint project like photoshop using c#. I have used GDI+
NOTE: I have read Routing From the Inside Out AND the Engine Yard blog
Note: I have almost no idea at all how batch file 'for' loops work.

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.