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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:37:23+00:00 2026-05-25T13:37:23+00:00

I have mouse actions triggering a custom function on the html and body, however

  • 0

I have mouse actions triggering a custom function on the html and body, however the scroll bars and a form I have on the page has now become unresponsive to mouse clicks!

$('html,body').bind('mousedown mouseup mouseover mousemove', function(e){
    e.preventDefault(); //this is required :(
    customFunction();
});

(Why do I need prevent default? full customFunction here)

How do I preserve the body binding while keeping the form usable and the scroll bars functioning?

I have a JSFiddle demo here, showing exactly what is happening:
http://jsfiddle.net/Ywg9T/

  • 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-25T13:37:23+00:00Added an answer on May 25, 2026 at 1:37 pm

    This is a bug in jQuery, related to the event for starting a selection. It fires way too frequently. There is a ticket filed for it, and it scheduled to be fixed in 1.8. In the meantime, you can fix this problem by hackily removing that event handler (where ‘element’ is the element you want to disable it for — in your case, the whole document):

    element.onselectstart = function () { return false; };
    

    Then you don’t have to do preventDefault. So, your code would look something like this:

    document.onselectstart = function () { return false; };
    (function($){
        var drag = false;
        $("#click").bind('mousedown mouseup mouseover mousemove', function(e) {
            if(e.type === 'mouseover'){ ... }
            if(e.type === 'mousemove'){ ... }
            if(e.type === 'mousedown'){ ... }
            if(e.type === 'mouseup'){ ... }
        });
    })(jQuery);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like have three mouse actions over a control: left, right and BOTH.
I have an html link that has uses hover() (well, the hoverIntent plugin...but same
I have a CListBox with custom drawing being used, and need to detect mouse-clicks
I have a jquery function that binds a select field on a form to
I have a table-row that has a JavaScript action attached to mouse clicks anywhere
I have an iFrame with custom website page loaded into it. I am trying
http://jsfiddle.net/HVGre/1/ - test link. I have an html link on my page that I
I am writing a game in Java, and need to have mouse interaction. I
I have set mouse events on a Canvas as follows: <Canvas MouseUp=CanvasUp MouseDown=CanvasDown MouseMove=CanvasMove>
I'm writing a simple game and I'm going to have the mouse control the

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.