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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:22:11+00:00 2026-05-24T01:22:11+00:00

I am using a pre-existing jQuery popup plugin for a WordPress site. The popup

  • 0

I am using a pre-existing jQuery popup plugin for a WordPress site. The popup works great but the only problem is the styling – it didn’t include any sort of “overlay” in the design. Since I want the background to “grey out”, I set out to adding some classes and styles to the css to make this happen, but am running into a wall.

Here was the original HTML:

<div id="messagebox" class="visiblebox">
    <a href="" id="closebox" title="Close this box"></a>
    <div id="message">message content</div>
</div>

And I added a div above that to create this HTML:

<div id="popupOverlay" class="visiblebox"></div>
<div id="messagebox" class="visiblebox">
    <a href="" id="closebox" title="Close this box"></a>
    <div id="message">message content</div>
</div>

Here is the JS – I added the 2nd line to the removeMessageBox function below after editing my HTML per above:

function removeMessageBox() {
    jQuery(this).parent('#messagebox').removeClass('visiblebox').addClass('hiddenbox');
    jQuery(this).parent('#popupOverlay').removeClass('visiblebox').addClass('hiddenbox');
    return false;
}


function boardReady() {
    jQuery('#closebox').click(removeMessageBox);
    jQuery('#messagebox').css('visibility', 'visible');
}

jQuery(window).load(boardReady);

And here is some corresponding CSS:

div#popupOverlay.visiblebox {display: block;}
div#popupOverlay.hiddenbox {display: none;}
div#messagebox.visiblebox {display: block;}
div#messagebox.hiddenbox {display: none;}

Of course, it’s not working. I barely know any JS so I’m not sure exactly what to add to the right function to get the same effect of the close action when clicked on the close link.

  • 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-24T01:22:12+00:00Added an answer on May 24, 2026 at 1:22 am

    I see. Why don’t you try this

    function removeMessageBox() {
        jQuery('#messagebox').removeClass('visiblebox').addClass('hiddenbox');
        jQuery('#popupOverlay').removeClass('visiblebox').addClass('hiddenbox');
        return false;
    }
    

    There is no need for all the jQuery traversing (i.e. using the .parents() method) as both elements have unique IDs. The problem with your code is that #popupOverlay is not a parent of closebox.

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

Sidebar

Related Questions

Bit of a newb but just having a small problem using jquery cycle all
Are there any good tools for visualising a pre-existing database schema? I'm using MySQL
I'm using the Java spring framework for security. My pre-existing table layout differs from
I am mapping some pre-existing Business Objects to our database using Entity Framework. These
I'm using EF Code First with a pre-existing database. Two objects: public Foo {
I am working with a pre-existing zen-cart site has been worked on over the
I have begun using Eclipse code templates and am loving 'em! But for existing
Is there anyway to restrict by using pre-processing directives to prevent a project from
Using the Pre Release Xcode 3.2.3 I get this as a Startup Project (source:
I am using some pre-written JavaScript from polldaddy. They have a JavaScript option which,

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.