473,573 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

firefox onmousemove and dragging issues

I'm trying to create a basic slider and I'm having absolutely no luck
in firefox. Could someone please offer some hints as to what could be
wrong? I think it's to do with the focus change upon clicking, but I'm
not sure. It's just not dragging properly. It's at

http://users.tpg.com.au/sobey1/slide.html

Cheers
dave

Jan 9 '06 #1
8 12074
"davefromalbury " <da********@gma il.com> wrote in
news:11******** **************@ g44g2000cwa.goo glegroups.com:
I'm trying to create a basic slider and I'm having absolutely no luck
in firefox. Could someone please offer some hints as to what could be
wrong? I think it's to do with the focus change upon clicking, but I'm
not sure. It's just not dragging properly. It's at

http://users.tpg.com.au/sobey1/slide.html

Seems to be dragging okay to me with the movement right to left to right of
the mouse. You might want some sort of onmouseout event to break the link
between the mouse and the slider knob when the cursor leaves any part of
the slider.
....

Jan 9 '06 #2
i'm using firefox 1.5, is that what you checked it with? Maybe it's
just my browser being wierd, but I don't think so.

Cheers
dave

Jan 9 '06 #3
VK

davefromalbury wrote:
I'm trying to create a basic slider and I'm having absolutely no luck
in firefox. Could someone please offer some hints as to what could be
wrong? I think it's to do with the focus change upon clicking, but I'm
not sure. It's just not dragging properly. It's at

http://users.tpg.com.au/sobey1/slide.html


No it's not a focus issue. When you drag mouse over an part of your
page (thus passing mouse over with button pressed), you first fire
"selectstar t" event (system is trying to select the text). It fails on
image and then fires "ondragstar t" event (system is trying to move an
atomic object). It fails on it either - at this moment cursor changes
to "No-Drag" ("Unavailabl e" by Windows). You need to release the mouse
to let the call for mousemove to go through.

This is the standard consequence of events, but up to date the only
browser which asknowledges it is that terrible borken non-standard
Micro$oft IE :-): here you have onselectstart and ondragstart event
handlers to cancel these events programmaticall y.

There are different tricks to kill ondragstart on different browsers.
Very well can be that there are some official documented ways for that
which I'm not aware of. Personally since NN4 I'm using "background
trick" for images: instead of making an image to be the content, I'm
making it background-image of an element w/o content. But I used it for
div/span only, so I do not know how will it behave on a table cell.

Jan 10 '06 #4
"davefromalbury " <da********@gma il.com> wrote in
news:11******** **************@ g14g2000cwa.goo glegroups.com:
i'm using firefox 1.5, is that what you checked it with? Maybe it's
just my browser being wierd, but I don't think so.


Yes, I develop with FF 1.5, and check with IE6. When the mouse cursor is
"attached" to the slider knob by a click of the cursor over the knob, it
slides with the cursor in its left-right-left movement. When the cursor
moves off the slider, the knob continues its left-right movement in FF1.5,
but not in IE6, from what I can see. Clicking on the slider knob again to
"detach" cursor movement from slider knob movement works in both browsers,
probably the effect you are looking for.

Jan 10 '06 #5
i was just about to post the answer you suggested :) Yes, it works
perfectly: as you said, you simply make the image a background image
with css.

cheers
dave

Jan 10 '06 #6
VK wrote :
davefromalbury wrote:
I'm trying to create a basic slider and I'm having absolutely no luck
in firefox. Could someone please offer some hints as to what could be
wrong? I think it's to do with the focus change upon clicking, but I'm
not sure. It's just not dragging properly. It's at

http://users.tpg.com.au/sobey1/slide.html
No it's not a focus issue. When you drag mouse over an part of your
page (thus passing mouse over with button pressed), you first fire
"selectstar t" event (system is trying to select the text). It fails on
image and then fires "ondragstar t" event (system is trying to move an
atomic object). It fails on it either - at this moment cursor changes
to "No-Drag" ("Unavailabl e" by Windows).


selectstart and ondragstart are not standards event types and are not
supported by Firefox.
In Fx, the OP needs to cancel default action of the mousedown. Anyway,
the markup code is not that good either.

You need to release the mouse to let the call for mousemove to go through.
He needs to register the mousemove event once and only once the
mousedown event has been triggered, fired.


This is the standard consequence of events, but up to date the only
browser which asknowledges it is that terrible borken non-standard
Micro$oft IE :-): here you have onselectstart and ondragstart event
handlers to cancel these events programmaticall y.
Once he registered an event listener (DOM 2 Events) on the image,

evt.preventDefa ult()

http://www.w3.org/TR/2000/REC-DOM-Le...preventDefault

so that default action of the mouse is neutralized.

There are different tricks to kill ondragstart on different browsers.
Very well can be that there are some official documented ways for that
which I'm not aware of. Personally since NN4 I'm using "background
trick" for images: instead of making an image to be the content, I'm
making it background-image of an element w/o content. But I used it for
div/span only, so I do not know how will it behave on a table cell.


I think if he could get rid of the table and cells, it would be better.

Gérard
--
remove blah to email me
Jan 13 '06 #7
VK

Gérard Talbot wrote:
selectstart and ondragstart are not standards event types and are not
supported by Firefox.
Which is a major flaw (one of) of the current Gecko architecture.
Once he registered an event listener (DOM 2 Events) on the image,
evt.preventDefa ult()


preventDefault of what? Default action on "mousedown" is not
selectionstart.
selectionstart starts when you move mouse for at least one pixel in any
direction *with mouse button down*. There is no such listener in Gesco
model which you could override. This is the main reason why even
semi-working drag solutions for Gesco are continuosly on the "border
line of selection" - you move mouse a bit quicklier or trickier and
voila - it starts select the content instead of dragging it.

I'm ready to believe that modern Gecko allows you to prevent selection
by canceling mousedown event (I did not play drag-drop scripts
recently). But in such case it just a non-standard way to fix W3C event
model flaw.

Jan 13 '06 #8
VK wrote:
Gérard Talbot wrote:
selectstart and ondragstart are not standards event types and are not
supported by Firefox.


Which is a major flaw (one of) of the current Gecko architecture.


No, it is not. And even if they were standard event types, no UA would
be obliged to implement it, even if it implemented other W3C DOM Events.
PointedEars
Jan 13 '06 #9

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

Similar topics

3
5701
by: Gary Mayor | last post by:
Hi, I'm re phrasing and earlier question as the earlier question doesn't make to much sense. I using document.onmousemove to move a <div line on the screen. At the moment if I click and move the mouse over the image it doesn't move the line but if I click off the image and move the mouse the line moves like it's supposed to. Also if I click...
2
2765
by: Mariusz | last post by:
Hello, I'm trying to do drag'n'drop where You can see elements that You are dragging (table rows exactly) but I have small problem. Here is code sample var move = false; function onDragStart(id) { move = true; return true; }
4
2150
by: Schraalhans Keukenmeester | last post by:
I have no clue why below code (found it somewhere and altered it a wee bit to my needs) will run without problem in both IE and Mozilla FireFox 1.0 but in the latter it takes up close to 100% cpu. It does check for type of browser, and indeed all works fine apart from that ridiculous amount of cpu taken. If you want to see if it does so in...
36
3537
by: Simon Wigzell | last post by:
I have the following in my webpage: <body onresize=CenterIt(); onMouseMove=mouseCheck(event);> CenterIt and mouseCheck are my own javascript functions. Works fine for IE and Opera, doesn't even go into the function for Firefox or Netscape. Is there a different way to assign functions to events that will be understood by "all" browsers?...
2
5354
by: AndrewW | last post by:
Hi I have an application that draws a selection rectangle over a map image. I can get it to work fine in IE and Opera, but not Firefox/Netscape. I've thrown the following small example together to illustrate the problem - the problem being that FF/NE initially draw my rectangle before the icon changes immediately to the black no-entry...
13
4391
by: bgraphics2031 | last post by:
I'm trying to get this iframe to dynamically resize by dragging a vertical bar, but it's not working in Mozilla (It originally worked in IE but I've been trying to port it over). Any help will be appreciated. Here's the resize.js var sResizableElement = "TH"; //Elements to be resized var iResizeThreshold = 8; var iEdgeThreshold = 8; var...
2
1658
by: Nathan Sokalski | last post by:
I have the following code which allows you to drag a div in IE, and have it then move back to it's natural position when you release the mouse button: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><script type="text/javascript">var...
0
8014
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. ...
1
7771
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...
0
8060
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...
1
5581
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5289
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...
0
3730
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3731
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1297
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1038
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.