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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:21:50+00:00 2026-06-14T00:21:50+00:00

I am trying to use the jQuery tools overlay, and it works very nicely

  • 0

I am trying to use the jQuery tools overlay, and it works very nicely when there is a static set of buttons that launch the overlay.

However, when the buttons that are linking to the overlay are recreated, the overlay seems to get orphaned and I can’t see why. I can’t close it, and I can’t even find a reference to it by going through the DOM with each().

I’ve seen some solutions which involve triggering a click, but for one thing this seems like an inelegant solution, and for another it causes the overlay to flicker before closing when I try it. I’d like to understand the reason why this doesn’t work, as well as a good solution, can anyone help?

HTML

<div id="container">

</div>
<button class='modalLaunch' rel='#modal'>
    Uncontained launch button
</button>
<div id="modal">
    Modal
    <button id="rebuildContainer">Rebuild container</button>
</div>

​
Javascript

$(document).ready(function() {
    $("#modal").hide();

    var rebuildContainer = function() {
        $("#container").html("<button class='modalLaunch' rel='#modal'>Contained launch button 1</button><br><button class='modalLaunch' rel='#modal'>Contained launch button 2</button>");           

        var triggers = $(".modalLaunch").overlay({
            mask: {
                color: '#bbbbee',
                loadSpeed: 200,
                opacity: 0.9
            },
            closeOnClick: true,
            load: false
        });
    }

    $("#rebuildContainer").click(function() {
        console.log("rebuilding buttons inside the container div");

        $(".modalLaunch").each(function() {

            var o = $(this).overlay();
            if (o) {
                console.log("there is an overlay associated with this button");
                if (o.isOpened()) {
                    // I would expect this to be true once each time the handler is called
                    console.log("the overlay associated with this button is open");
                }
            }
        });

        $(".modalLaunch").overlay().close();
        rebuildContainer();
    });

    rebuildContainer();
});

​

http://jsfiddle.net/EveryoneMustWin/hjJtc/

Thanks for your 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-14T00:21:51+00:00Added an answer on June 14, 2026 at 12:21 am

    Since asking this, I’ve read this question jQuery Tools Alternatives? and decided that it’s probably best to abandon jQuery Tools. The forums on their site don’t even let you start a new thread!

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

Sidebar

Related Questions

I'm trying to use the JQuery tools tooltips plugin in a site that I'm
I'm trying to use Jquery to pass the value of one box that already
im trying to use jquery tools tooltip ( http://flowplayer.org/tools/tooltip.html#events)on a form to show hints
I am trying to get the jQuery Tools overlay to work. The problem is
I was trying out jquery-overlay-example but with radio buttons. So after the page loads,
I'm trying to use both the BlockUI and jQuery Tools Tooltip plugins on the
I am trying to use flowplayer's overlay to load an external page that has
I'm trying to figure out how to use JQuery to display some tools when
I'm trying to use jQuery Tools Scrollable, I have used it before many times,
I am trying to use jQuery Tools to setup some tooltips dynamically, but I

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.