473,757 Members | 3,768 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 12089
"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
5719
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 it off the image and move the mouse over the image it then works. Something on clicking the image...
2
2782
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
2163
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 your firefox/xp too, it's embedded in my homepage (www.westerterp.com) Can anyone explain why...
36
3565
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? Thanks!
2
5366
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 icon. Then, when I let go of the mouse, the rectangle continues drawing, but it
13
4413
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 iSizeThreshold = 20; var sVBarID = "VBar"; var oResizeTarget = null; //position and distance moved
2
1680
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 draggable=0;</script></head> <body> <div id="div1"
0
9487
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
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9904
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
9884
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
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6556
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
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
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
3
2697
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.