473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 12056
"davefromalbury" <da********@gmail.com> wrote in
news:11**********************@g44g2000cwa.googlegr oups.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
"selectstart" event (system is trying to select the text). It fails on
image and then fires "ondragstart" event (system is trying to move an
atomic object). It fails on it either - at this moment cursor changes
to "No-Drag" ("Unavailable" 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 programmatically.

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********@gmail.com> wrote in
news:11**********************@g14g2000cwa.googlegr oups.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
"selectstart" event (system is trying to select the text). It fails on
image and then fires "ondragstart" event (system is trying to move an
atomic object). It fails on it either - at this moment cursor changes
to "No-Drag" ("Unavailable" 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 programmatically.
Once he registered an event listener (DOM 2 Events) on the image,

evt.preventDefault()

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.preventDefault()


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
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...
2
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...
4
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....
36
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...
2
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...
13
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...
2
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.