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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:26:24+00:00 2026-05-23T05:26:24+00:00

I am using Ben Alman’s outside events plugin to close a modal window when

  • 0

I am using Ben Alman’s outside events plugin to close a modal window when the user clicks outside of it. This worked great until I had the need to use jQuery UI’s datepicker inside the modal. Since the elements comprising the widget are not placed inside the modal, the modal closes when selecting a date, which is the correct behavior. To attempt to solve the problem, I did the following:

$('#modal-window, #ui-datepicker-div').one('clickoutside', function(){

    // close the modal window

});

That just causes the modal window to close when it is clicked.

  • 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-23T05:26:25+00:00Added an answer on May 23, 2026 at 5:26 am

    From the page you link in your question:

    Note that you can also utilize the event.target property, which references the actual element clicked, in your event handler logic. This may be useful if you want to constrain the ‘outside-ness’ of the click to certain elements or containers.

    I’d use event.target along with closest to find whether the link was in the datepicker.

    $('#modal-window').one('clickoutside', function(event) {
        if (!$(event.target).closest('#ui-datepicker-div').length) {
            $(this).hide(); // or whatever code you have for hiding the modal window
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery + the hashchange plugin from ben alman. Below is a
I'm using the jQuery plugin hashchange: http://benalman.com/projects/jquery-hashchange-plugin/ $(function(){ $(window).hashchange( function(){ // location.hash }) $(window).hashchange();
I'm trying to use Ben Alman's jquery plugin debounce which will limit the times
I'm using Ben Almans plugin for hash change tracking: http://benalman.com/projects/jquery-hashchange-plugin/ Also I've modified my
Using C#, I need a class called User that has a username, password, active
I'm using http://benalman.com/projects/jquery-hashchange-plugin/ to listen for hash changes in my project, but his plugin
I'm using Ben Nadel's iFrame Upload function for an editing tool on a site
Using MySQL 5 with table abrechnung id datum title betrag wal jon al ben
I am using Eclipse with the PyDev plugin. I am using xlwt which is
I am using this javascript ( Super Table ) to transform my table in

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.