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 8397207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:43:50+00:00 2026-06-09T20:43:50+00:00

I have a div called toprightbox whose html I am changing on click using

  • 0

I have a div called toprightbox whose html I am changing on click using jquery:

$(".icon").click(function(){
$("#toprightbox").html('<a rel="prettyPhoto[artwork]" href="large.jpg">
<img src="thumbnail.jpg"  width="100" height="100" /></a>'); 
}

The change in html above via jQuery makes a call to the prettyPhoto lightbox to open a larger image in the prettyPhoto lightbox…

I would like to know why this is not working. The link () and the html is generated but apparently making a jQuery call within jQuery code seems impossible. The prettyPhoto lightbox does not work…please help!

  • 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-09T20:43:52+00:00Added an answer on June 9, 2026 at 8:43 pm

    It works. The problem is the order in which you call the code.

    1. Your page is loaded, all initial html is being rendered.
    2. The plugin you are using is called in the $(document).ready(function() { .... }); part of your page (I hope!). If you call your lightbox plugin there (say, on the items with a certain class), it will apply it to all items currently falling within the bounds of that selector.
    3. Afterwards, at some point in time, the user clicks an “.icon” element. Therefore, the new link is added. Your plugin does not work because it was never applied to that newly created link.

    So you’ll have to call your plugin again in a new step 4.

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

Sidebar

Related Questions

I have a div called #footer , whose margin is animated using jQuery to
I have a div called 'div.cloneFrame', and i am cloning that using jquery.clone. it
I have a function called goRight() which does some stuff when I click a
I have created a div using jquery and put some text in it: var
I have a div called address which as a textarea. When I click a
I have a DIV Called fArea and when i click the open button it's
I have a blank div called content. Links are later added to content using
I have a div called images_box which has a width of 277px . Within
I have a div called test and mvc action in the client controller The
I've got 3 tabs. Each of them have a div called optional , apart

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.