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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:52:55+00:00 2026-05-29T03:52:55+00:00

This is my code: // Close the bubble when we click on the screen.

  • 0

This is my code:

// Close the bubble when we click on the screen.
document.addEventListener('mousedown', function (e) {
// if ain't right click
if(e.button != 2){
    // hide
    setTimeout("bubbleDOM.style.visibility = 'hidden';", 500);
}
}, false);

My probem is that when the user tries to scroll with the browser scroller the
setTimeout takes effect. How do i check that the mousedown isn’t in the scroller?

  • 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-29T03:52:56+00:00Added an answer on May 29, 2026 at 3:52 am

    Make sure the button is left and make sure it’s not a bubbling event, not just if it’s not right. I’d suggest to also use a function in setTimeout, so:

    // Close the bubble when we click on the screen.
    document.body.addEventListener('mousedown', function(e) {
        // If it's a left click and the target is the current target
        if(e.button === 1 && e.target === e.currentTarget) {
            // hide
            setTimeout(function() {
                bubbleDOM.style.visibility = 'hidden';
            }, 500);
        }
    }, false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem on this code $(document).ready(function(){ $('.nm_close').click(function(){ $('.map_pops').css('display','none'); }); }); What I
I am trying this code: function view_mail_popup_close() { setTimeout("function () { $('#popupbox').fadeOut('slow'); }",200); setTimeout("function
i have a button to close my app with this code: finish(); the problem
I'm using this code on the close function of a jQuery UI dialog: close:
I have this code: <div id=parent1> <div id=child1></div> <!-- Which is a close button
this is my code: f = open('text/a.log', 'wb') f.write('hahaha') f.close() and it is not
I've see this sort of thing in Java code quite often... try { fileStream.close();
I have a greasemonkey user script with this single line of code... window.close(); but
Using this code import re file = open('FilePath/OUTPUT.01') lines = file.read() file.close() for match
So, this code splits the screen into two frames: Javascript:A14nH=location.href;L3f7=http://www.google.com;R1Gh7=http://www.google.com;if(L3f7&&R1Gh7){Fr4Q='<frameset%20cols=\'*,*\'>\n<frame%20src=\''+L3f7+'\'/>';Fr4Q+='<frame%20src=\''+R1Gh7+'\'/>\n';Fr4Q+='</frameset>';with(document){write(Fr4Q);void(close())}}else{void(null)} I need to run

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.