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

The Archive Base Latest Questions

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

I have built a modal box, which uses a cover-all div background to fade

  • 0

I have built a modal box, which uses a cover-all div background to fade out the content and allow the user to click off the box in order to close it. I do this by capturing all of the clicks, but filtering out any that are over the model box.

  $('body').on('click', '.cover_slide > *',function(e){
    e.stopPropagation();
  });
  $('body').on('click', '.cover_slide',function(){
    helper.cover.close();
    $('body').off('click', '.cover_slide');
  });

I would like to be able to interact with some elements on my modal box with clicks, but I can’t seem to figure out how to do that AND still have my ‘click off to close’ function. At present all clicks on the box are ignored.

  • 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-14T09:18:23+00:00Added an answer on June 14, 2026 at 9:18 am

    There is no need to bind the click multiple times. Try using this snippet. Note that you might have to change the closest selector depending on what the element really is

    $(document).bind("click", function(e) {
        if($(e.target).closest("div").hasClass('coverSlide')) {
            //do stuff if someone clicks the box
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a site which requires user to login. Now I have decided
In an asp.net web application, I have a modal popup built with a Telerik
I have a model that has a ForeignKey to the built-in user model in
I currently have a DetailView for Django's built-in User . url( r'^users/(?P<pk>\d+)/$', DetailView.as_view( model
I have built so far an application that allows the user to drag and
I have a Silverlight application which uses 2 separate databases. I have a situation
In the webapp I've built, user authentication is handled in a modal, jQuery window.
I have a windows gui built in Microsoft Visual C++ and when the user
I am trying to build a modal dialog box in JavaScript. I have it
Background: I have a Windows 2008 R2 box set up with SQL 2008 R2

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.