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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:48:14+00:00 2026-06-09T19:48:14+00:00

I have a <div> element that is created in my script and appended to

  • 0

I have a <div> element that is created in my script and appended to another <div>. I have:

 coverElm.onmousedown = mouseDownEventHandeler;
 document.onmouseup = mouseUpEventHandeler;
 document.onmousemove = mouseMoveEventHandeler;

I have the functions defined and work great and keep track of if the mouse is down with a boolean mouseDown.

The Problem – When the mouse is pressed down and is released the document.onmouseup is never handled. I think its because its doing a drag of whatever is in the <div> witch is just a few words of text. I have this issue without text too.

So what I’m looking for is a way to prevent this odd dragging behavior, or way for onmousedrag to see if the mouse is pressed down of not – NOT USING THE MOUSE UP AND MOUSE DOWN METHODS

Here are my functions:

function mouseUpEventHandeler(e) {
        mouseDown = false;
}
function mouseDownEventHandeler(e) {
        mouseDown = true;
}
function mouseMoveEventHandeler(e) {
        if (mouseDown) {
               coverElm.innerHTML ="<p>Mouse down and dragging</p>";
        }
}
  • 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-09T19:48:16+00:00Added an answer on June 9, 2026 at 7:48 pm
    $j(divID).bind('dragstart', function (event) { event.preventDefault() });
    

    Thanks all

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

Sidebar

Related Questions

I have a script that create a new div element. Then, I want to
I have a script which appends a newly-created div to the body element onload.
I have a basic div element to represent a message that I show for
I have a div that will serve as container to other element, I have
I have code that adds a pre-determined HTML snippet into a pre-determined <div> element
I have a div element in an HTML document. I would like to extract
I have the following script that creates a div, adds a Google Maps DOM
I have a selenium script that I created with Selenium IDE. I was wondering
I have a div with the ID 'headercontent' and I have a script that
I have two div elements that are twins (i.e. their dimensions and contents are

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.