Firefox onmousedown popup/layer focus/blur

A

atn2002

I'm trying to create a control which when the mouse button gets
pressed on one div an absolute positioned div pops up in
place of the cursor. From there the cursor should interact with
the dialog before the mouse button is released. In other words
one element will catch onmousedown, display the popup, and
the popup element will catch onmouseup. This works fine in
IE as the popup automatically accepts following events,
but my problem is in Firefox. In Firefox everything behind the popup
still receive events even though they can't be seen
(hidden by the popup). I have to release the mouse button and then
click on the popup again before it accepts the onmouseup event.
I also used a different cursor on the popup to see if Firefox
recognized it was there at all. Still the cursor doesn't change
until I release themouse button and move the cursor across
the popup element.

I've tried focus/blur, timeout delays, hiding the first element
(the one which receives onmousedown) but nothing works.
The only thing that works is hiding the entire body and then
using setTimeout to show the entire body again 1ms later.
Obviously though that is very ugly. Any other ideas...please!?!?!?!
 
P

Peter Michaux

I'm trying to create a control which when the mouse button gets
pressed on one div an absolute positioned div pops up in
place of the cursor. From there the cursor should interact with
the dialog before the mouse button is released. In other words
one element will catch onmousedown, display the popup, and
the popup element will catch onmouseup. This works fine in
IE as the popup automatically accepts following events,
but my problem is in Firefox. In Firefox everything behind the popup
still receive events even though they can't be seen
(hidden by the popup). I have to release the mouse button and then
click on the popup again before it accepts the onmouseup event.
I also used a different cursor on the popup to see if Firefox
recognized it was there at all. Still the cursor doesn't change
until I release themouse button and move the cursor across
the popup element.

I've tried focus/blur, timeout delays, hiding the first element
(the one which receives onmousedown) but nothing works.
The only thing that works is hiding the entire body and then
using setTimeout to show the entire body again 1ms later.
Obviously though that is very ugly. Any other ideas...please!?!?!?!

Can you post a complete web page with about fourteen lines that shows
the problem in action?

Peter
 
A

atn2002

As I was putting together this demonstration it never happened. Until
I put an image in...so the problem seems to be with Firefox's image
dragging. I never expected it was that though because on the actual
source I'm working with the image is only 1px wide acting as a vertical
spacer for old IE. Either way ideally it would be best to be able to
get around this image dragging. Any ideas?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div style="background: blue; position: absolute; left: 100px; top:
100px; width: 35px; height: 35px;" onmousedown="javascript:
document.getElementById('popupdiv').style.display = 'block';"><img
src="http://www.google.ca/options/icons/groups.gif" style="width: 35px;
height: 35px;"></div>
<div id="popupdiv" style="background: red; position: absolute; left:
100px; top: 100px; width: 35px; height: 35px; display: none; cursor:
move;" onmouseup="alert('MouseUp Fired!');"></div>
</body>
</html>
 
A

ASM

(e-mail address removed) a écrit :
As I was putting together this demonstration it never happened. Until
I put an image in...so the problem seems to be with Firefox's image
dragging. I never expected it was that though because on the actual
source I'm working with the image is only 1px wide acting as a vertical
spacer for old IE. Either way ideally it would be best to be able to
get around this image dragging. Any ideas?

your code bellow,
- with my FF2, Safari 1.3, iCab 3, works fine
(even if image size is 1px or if *no image*)
- with my Opera the red div needs to be re-clicked to fire
- with my IE 5.2 the red div never fires
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top