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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:16:45+00:00 2026-05-20T07:16:45+00:00

My original HTML is: <div class=add-inv-button>Add to Your Game Plan </div> I have the

  • 0

My original HTML is:

<div class="add-inv-button">Add to Your Game Plan </div>

I have the following jQuery code:

    jQuery('.add-inv-button').click(function(){  
    jQuery(this).removeClass('add-inv-button');
    jQuery(this).addClass('completed-button');
    jQuery(this).html('<a class="open-popup" href="#popup01">Done it!</a>'); });

And I have the following simplelightbox reference:

$(function(){
    jQuery("a.open-popup").simpleLightbox({
        closeLink:'a.close'  
    });
})

This is what’s supposed to happen:
After I click on “add-inv-button”, the HTML updates, creating an anchor with class “open-popup”. After I click on this anchor, the simplelightbox div at #popup01 (on the same page) appears (with z-index of 999).

However, this is what actually happens: After I click on the “add-inv-button”, the HTML updates correctly. But when I click on the new anchor, the browser does not jump to the #popup01 simplelightbox on the page. It clears the page and tries to link to http://www.mydomain.com/#popup01 instead, resulting in an empty page.

It seems like the jQuery simplelightbox doesn’t detect the a.open-popup link because the link was added after the page originally loaded. If I refresh the page, then everything works correctly.

How should I fix this? Thanks.

  • 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-20T07:16:45+00:00Added an answer on May 20, 2026 at 7:16 am

    Add the lightbox code to the click function:

    jQuery('.add-inv-button').click(function(){  
        jQuery(this).removeClass('add-inv-button')
                    .addClass('completed-button')
                    .html('<a class="open-popup" href="#popup01">Done it!</a>')
                    .find("a.open-popup").simpleLightbox({
                       closeLink:'a.close'  
                    });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML code: <div id=summary_form> <textarea class=summary>Please fill in</textarea><br/> <textarea class=summary>Please
I have a box where I am trying to add a button to the
I have a div with its default class giving it a green background. When
Original Question I am writting a logging class where the goal is to be
Solution to original problem (below) may have been discovered. I commented out <identity> ...
I have some dynamic text contained in a div that is set to whatever
Original Question I want to be able to generate a new (fully valid) MP3
Original Question I am looking for a function that attempts to quantify how distant
Original Question What I'd like is not a standard C pre-processor, but a variation
The original query looks like this (MySQL): SELECT * FROM books WHERE title LIKE

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.