[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

which mouse button pressed

Still struggling with implementing my custom drag and drop operation ...

can someone tell me if it's possible to tell which mouse button is being pressed (if any) when an onmouseout message is generated? I want to know if the left mouse button is being pressed:

function MyOnMouseOutHandler()
{
    if (event.button == 1) {
        alert("Yes left mouse button was held down when leaving!")
    }
}
0
minnirok
Asked:
minnirok
  • 3
  • 2
1 Solution
 
minnirokAuthor Commented:
Hi Lakio,

I was trying to implement my own drag and drop by using the default onclick, onmove, onmouseout - but they keep getting overridden by the actual ondragstart handlers. It seems like in internet explorer ondragstart gets called ok, but in firefox it does not? I have something like the following:

<div id = "mydiv" ondragstart="alert('hello')"></div>

in internet explorer this will get called, but in firefox this is never called. Does firefox have anything like that?

Thanks
0
 
LakioCommented:
"in internet explorer this will get called, but in firefox this is never called. Does firefox have anything like that?"
- no I dont think so

take a look and see who they did it
http://elouai.com/javascript-drag-and-drop.php
http://www.walterzorn.com/dragdrop/dragdrop_e.htm
0
 
minnirokAuthor Commented:
Thanks Lakio, the first link was simple enough to incorporate. I needed to make some changes to get it to work the way I want. I do have one more question regarding it which I'll post in a moment.
0
 
LakioCommented:
np m8 but so you now I think http://www.walterzorn.com/dragdrop/dragdrop_e.htm has a better script
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now