473,811 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox onmousedown popup/layer focus/blur

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! ?!?!?!

Nov 12 '06 #1
3 6867
at*****@hotmail .com wrote:
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

Nov 12 '06 #2
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="backgrou nd: blue; position: absolute; left: 100px; top:
100px; width: 35px; height: 35px;" onmousedown="ja vascript:
document.getEle mentById('popup div').style.dis play = 'block';"><img
src="http://www.google.ca/options/icons/groups.gif" style="width: 35px;
height: 35px;"></div>
<div id="popupdiv" style="backgrou nd: red; position: absolute; left:
100px; top: 100px; width: 35px; height: 35px; display: none; cursor:
move;" onmouseup="aler t('MouseUp Fired!');"></div>
</body>
</html>

Nov 12 '06 #3
ASM
at*****@hotmail .com 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

<!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="backgrou nd: blue; position: absolute; left: 100px; top:
100px; width: 35px; height: 35px;" onmousedown="ja vascript:
document.getEle mentById('popup div').style.dis play = 'block';"><img
src="http://www.google.ca/options/icons/groups.gif" style="width: 35px;
height: 35px;"></div>
<div id="popupdiv" style="backgrou nd: red; position: absolute; left:
100px; top: 100px; width: 35px; height: 35px; display: none; cursor:
move;" onmouseup="aler t('MouseUp Fired!');"></div>
</body>
</html>
Nov 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3774
by: Moist | last post by:
Hi, first I must admit this is one of the most active group I have ever seen. For my question: is it possible to create a small popup window that remain in focus until it is closed. That is, even if you click on the main (caller) window just beside the popup, the popup would remain in focus. I've tried "alwaysRaised" with window.open() function but it doesn't work, must be for something else!!!
4
2666
by: George Hester | last post by:
I have a page that when the user accesses certain links a chromeless window (2) appears and meshes with the newly formed parent window (1). Works nicely in IE 5+ but in IE 6 it's not so good but OK for now. Anyway in IE 5;5.5 the chromeless window appears. I have made it so (2) can be moved around on the screen with the mouse and also so that if the parent (1) is minimized leaving (2) only on the desktop when the links in that are clicked,...
15
18750
by: | last post by:
So many websites can get around my Googlebar's popup blockers. Even Opera 8 can not stop those popups. I looked into the codes, and I can find nothing showing me how it is done. Can anyone help me find what how it is done? First go to http://www.sitepoint.com/forums/showthread.php?t=184025&page=1&pp=25 Click on Last ? on the page
11
7363
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz 1.7.12 (linux kubuntu). It does work with konqueror. It seems to work with firefox on windows but not with IE (not completly sure though).
12
2621
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; oFoldMenu.make('sub3','')//spacer unfortunately, i have just viewed the site in IExplorer and it has added...
1
1634
by: Gotejjeken | last post by:
I have a form in a window and when the user closes the window I want to do a focus/blur on the form that opened the window in order to use some AJAX functionality. This will work fine in IE, however in Firefox I have to put an alert() before the focus/blur in order to get them to fire. My question is, is it possible to focus on a form element and blur off of that element in one window after closing another window without the use of an...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10652
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10395
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10408
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4346
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.