473,386 Members | 1,721 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,386 software developers and data experts.

style.cursor='hand' in FireFox not working??

CES
All,
I don't know why I always get stuck on the stupid questions...

This is pretty straight forward... I want to change the cursor to the hand on a mouse event. This works just fine, if I use other cursors, but for some reason I can't get the cursor:hand to work in Firefox???

<div class="showHideDiv" onmouseover="this.style.cursor='hand'" onclick="showHideDiv('Price')">
Price
</div>

Thanks in advance. - CES
Feb 6 '06 #1
19 157081
CES
CES wrote:
All,
I don't know why I always get stuck on the stupid questions...

This is pretty straight forward... I want to change the cursor to the
hand on a mouse event. This works just fine, if I use other cursors, but
for some reason I can't get the cursor:hand to work in Firefox???

<div class="showHideDiv" onmouseover="this.style.cursor='hand'"
onclick="showHideDiv('Price')">
Price
</div>

Thanks in advance. - CES


Never Mind it's onmouseover="this.style.cursor='pointer'... however I did find out that you can set cursor values for a div element from with in the style sheet it's self.

div{
cursor:pointer;
}

So at least it wasn't a total wast of time - CES
Feb 6 '06 #2
CES wrote:
This is pretty straight forward... I want to change the cursor to the hand
on a mouse event. This works just fine, if I use other cursors, but for
some reason I can't get the cursor:hand to work in Firefox???
The standard is "pointer", not "hand". "hand" is for IE 4/5.
<div class="showHideDiv" onmouseover="this.style.cursor='hand'"


It seems a bit off to dynamically change the cursor style onmouseover. Why
not just:

..showHideDiv {
cursor: pointer;
}

?

(And having "div" in the class name is also rather redundant).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 6 '06 #3
CES wrote:
All,
I don't know why I always get stuck on the stupid questions...

This is pretty straight forward... I want to change the cursor to the
hand on a mouse event. This works just fine, if I use other cursors, but
for some reason I can't get the cursor:hand to work in Firefox???

<div class="showHideDiv" onmouseover="this.style.cursor='hand'"
onclick="showHideDiv('Price')">
Price
</div>

Thanks in advance. - CES


try tis:

<style>
shohHideDiv{
cursor:pointer;
cursor:hand;
}
</style>

<div class="showHideDiv" onclick="showhideDiv('price');">price</div>

Ignace de Witte
http://www.reunionislandguns.com
Feb 13 '06 #4
Ignace de Witte wrote:
<style>
The type attribute is required.
shohHideDiv{
Class selectors start with a "."
cursor:pointer;
Correct
cursor:hand;


Invalid CSS. It /might/ be worthwhile given a significant proportion of
IE 5.x users - but there aren't a great many of them about these days
(and its just a minor bit of presentation).

Feb 13 '06 #5
David Dorward wrote:
Ignace de Witte wrote:
cursor:hand;


Invalid CSS. It /might/ be worthwhile given a significant proportion of
IE 5.x users - but there aren't a great many of them about these days
(and its just a minor bit of presentation).


Using Conditional Comments would allow for targeting those users too, and
keep the CSS valid.
PointedEars
Feb 18 '06 #6
Thomas 'PointedEars' Lahn wrote:
Using Conditional Comments would allow for targeting those users too, and
keep the CSS valid.


The CSS wouldn't be valid, it just wouldn't be tested if you pointed the CSS
validator at the HTML document.

One day I really must get around to testing what Internet Explorer would do
given <link rel="stylesheet" type="text/x-msss" href="foo.msss"> (with a
matching content type on the server).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 19 '06 #7
David Dorward wrote:
Thomas 'PointedEars' Lahn wrote:
Using Conditional Comments would allow for targeting those users too,
and keep the CSS valid.


The CSS wouldn't be valid, [...]


Yes, it would. Comments are not part of the resulting code.
PointedEars
Feb 19 '06 #8
Thomas 'PointedEars' Lahn wrote:
Thomas 'PointedEars' Lahn wrote:
Using Conditional Comments would allow for targeting those users too,
and keep the CSS valid.


The CSS wouldn't be valid, [...]


Yes, it would. Comments are not part of the resulting code.


As I said before - point the CSS validator directly at the stylesheet, and
not at the HTML document with the conditional comments and the error will
be highlighted.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 19 '06 #9
VK

David Dorward wrote:
Thomas 'PointedEars' Lahn wrote:
Thomas 'PointedEars' Lahn wrote:
Using Conditional Comments would allow for targeting those users too,
and keep the CSS valid.

The CSS wouldn't be valid, [...]


Yes, it would. Comments are not part of the resulting code.


As I said before - point the CSS validator directly at the stylesheet, and
not at the HTML document with the conditional comments and the error will
be highlighted.


So what is the point of the whole discussion?

It is up to developer and not up to anyone else to make the choice: "do
I need to support IE 5.x or not?" or say "Do I have to use iframe or
not". If the choice is made and it's positive, then just go by the
taken decision straight and forward.

I personally have to support IE 5.5x in many solutions. And I have no
option to tell my potential customers: "I cannot support your systems
because one PHP page on W3C will never show me the green banner on the
top for it". After such statement they may evacuate me to the closest
clinic.
Also Dr. VK suggests: if you catch yourselve one day *cheating* on that
PHP program to get the green banner (otherwise you cannot proceed with
your life) it is a good time to visit such clinic volunteerly because
you are getting dangerous for yourselve and for the society. :-) :-|

Yes, browser producers shouldn't bother developers with compatibility
issues at least in such primitive cases, the world should be better,
and my contract sum at least twice higher. One can add a bounch of
similar good suggestions :-), but it is what it is.

Feb 19 '06 #10
VK wrote:
I personally have to support IE 5.5x in many solutions. And I have no
option to tell my potential customers: "I cannot support your systems
because one PHP page on W3C will never show me the green banner on the
top for it". After such statement they may evacuate me to the closest
clinic.


Well:

(a) It is written in Java, not PHP

and

(b) You decide to deviate from the standard? That is your choice, but let us
not delude ourselves into thinking that it is anything other then deviating
from the standard.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 19 '06 #11
VK

David Dorward wrote:
(b) You decide to deviate from the standard?
I do not decide anything. I do what I have to do to get the money for
living. If I need to have proper cursor for IE 5, I'll do it. If I have
to make transparent Aqua for all current browsers, I'll do it. In such
cases W3C opinion will not stop me from taking the contract.
That is your choice, but let us
not delude ourselves into thinking that it is anything other then deviating
from the standard.


Actually wrong. It is the practical usage of standards as opposed to
philosophy thinking. In case like:
....
cursor: fooobar001;
cursor: catch22;
cursor: hand;
cursor: pointer;
....
CSS parser has a very clear prescribed behavior what to parse, what to
disrecard and what to apply and in what order. So I'm not clear why it
should complain for doing the job it was made for. Who told him that
say "catch22" is not a new cursor style from say CSS 5 proposals?

It is nothing in common with like:
width:100;
which is plain incorrect (no unit indicated).

Should ve continue in ciwas ?

Feb 19 '06 #12
VK wrote:
David Dorward wrote:
(b) You decide to deviate from the standard?
I do not decide anything. I do what I have to do to get the money for
living.
You might not see it as a choice, but it still is one. You could abandon any
family you have, move into the smallest, grottist bedsit you can find, and
work double shifts for a living instead. (No, I don't recommend that you
do, I just point out that there is a choice and thus you do make a
decision).
That is your choice, but let us not delude ourselves into thinking that
it is anything other then deviating from the standard.

Actually wrong. CSS parser has a very clear prescribed behavior what to parse, what to
disrecard and what to apply and in what order.
The spec describes how to cope in some cases when an author deviates from
the specification. Coding with the intention of triggering this error
handling is not the same as following the spec.
So I'm not clear why it should complain for doing the job it was made for.
Because that is the job it was made for.
Who told him that say "catch22" is not a new cursor style from say CSS 5
proposals?


Why should it care? It has profiles, the default of which is CSS 2. If you
are testing against the CSS 2 spec and have code which appears in a later
version of CSS but not in 2, then it should be expected that an error would
be thrown.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 20 '06 #13
VK

David Dorward wrote:
You might not see it as a choice, but it still is one. You could abandon any
family you have, move into the smallest, grottist bedsit you can find, and
work double shifts for a living instead.
.... because W3C decided that "pointer" is more correct term than "hand"
for the link pointer. :-D
Better then to go to Microsoft One Ave. and burn myself in front of the
entrance door. That also should be a note left in my car explaining
this action. By the price of my sorry life I may possibly save endless
young lives from the terrible choice I couldn't cope with.
:-)
The spec describes how to cope in some cases when an author deviates from
the specification. Coding with the intention of triggering this error
handling is not the same as following the spec.


Try to understand: W3C is not an all-knowing and all-seeing oracle
forseeing the future of the Web for 10 years in advance. And It is not
a salvation path neither ("follow W3C strictly and you'll be in the
heavens guaranteed"). It is a standartization organization consisting
of people of very different levels of knowledge doing their job
volunteerly at their spare time. Sometimes they indeed invent something
to follow, sometimes they propose dumb a** things you have to laught.

The real sort out may happen only *over the real usage*.

Right now I'm implementing behaviors for one project in IE/FF
compatible way:

div.draggable {
-moz-binding: "draggable.xml#init";
behavior: (draggable.htc);
}

Following your logic I should wait another N years before some unknown
and probably design clueless person in W3C decide what is the proper
name: "binding" or "behavior" ?

But OK, as you said it is always a decision. I made my decision, you
made yours.

Feb 20 '06 #14
VK wrote:
The spec describes how to cope in some cases when an author deviates from
the specification. Coding with the intention of triggering this error
handling is not the same as following the spec.
Try to understand: W3C is not an all-knowing and all-seeing oracle
forseeing the future of the Web for 10 years in advance.


Try to understand: It doesn't matter if you agree with a CSS specification
or not - if you don't follow it, then you aren't following it. There is no
value judgement involved in that statement.
Following your logic I should wait another N years before some unknown
and probably design clueless person in W3C decide what is the proper
name: "binding" or "behavior" ?


No. The logic I've been trying to explain in this thread doesn't kick in
until *after* you've decided to use the code that does not conform to the
specification. Then it says "You are deviating from the specification". At
no point in this thread have I said "Don't deviate from the
specification"[1], only that you shouldn't try to fool yourself or others
into thinking that such code obeys the spec.
[1] The closest I've come to that is to say that it might be worth deviating
from the specification if you need to support IE 5.x. That's practically a
suggestion to do it!

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 20 '06 #15
David Dorward wrote :
CES wrote:
This is pretty straight forward... I want to change the cursor to the hand
on a mouse event. This works just fine, if I use other cursors, but for
some reason I can't get the cursor:hand to work in Firefox???
The standard is "pointer", not "hand". "hand" is for IE 4/5.
<div class="showHideDiv" onmouseover="this.style.cursor='hand'"


It seems a bit off to dynamically change the cursor style onmouseover.


I agree.

Why not just:

.showHideDiv {
cursor: pointer;
}

?

(And having "div" in the class name is also rather redundant).


I believe the default cursor value for a div is pointer to begin with.

Gérard
--
remove blah to email me
Feb 20 '06 #16
David Dorward wrote:
Thomas 'PointedEars' Lahn wrote:
Thomas 'PointedEars' Lahn wrote:
Using Conditional Comments would allow for targeting those users too,
and keep the CSS valid.
The CSS wouldn't be valid, [...]

Yes, it would. Comments are not part of the resulting code.


As I said before - point the CSS validator directly at the stylesheet, and
not at the HTML document with the conditional comments and the error will
be highlighted.


I was talking about the commented stylesheet in the context of the HTML
document of course. And that is what matters regarding rendering.
PointedEars
Feb 20 '06 #17
David Dorward wrote:
(b) You decide to deviate from the standard? That is your choice, but let
us not delude ourselves into thinking that it is anything other then
deviating from the standard.


This argument is pointless, because what deviates from the standard
here is not even requested by standards compliant user agents. The
corresponding `style' element is none. It is part of a comment, and
it is /ignored/.
PointedEars
Feb 20 '06 #18
Gérard Talbot wrote:
I believe the default cursor value for a div is pointer to begin with.


No, it is 'default'.

From http://www.w3.org/TR/CSS2/ui.html#cursor-props :

default
The platform-dependent default cursor. Often rendered as an arrow.
pointer
The cursor is a pointer that indicates a link.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 20 '06 #19
VK

David Dorward wrote:
Try to understand: It doesn't matter if you agree with a CSS specification
or not - if you don't follow it, then you aren't following it. There is no
value judgement involved in that statement.
But that was *my* exact point in the original post:

<q cite="VK">
It is up to developer and not up to anyone else to make the choice: "do
I need to support IE 5.x or not?" or say "Do I have to use iframe or
not". If the choice is made and it's positive, then just go by the
taken decision straight and forward.
</q>

"straight and forward" includes "not cheating on validator just to get
the green light out of it". That is the question of the character
integrity (sorry for pathetic) and the regular mental sanity (see Dr.
VK's advise :-)

The same position I stated about HTML validator at
<http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/d5e3464f0c1cb4c8/a00ff71b4ac0bc05>
(you need to scroll as it was an off-topic branch of the thread)
No. The logic I've been trying to explain in this thread doesn't kick in
until *after* you've decided to use the code that does not conform to the
specification. Then it says "You are deviating from the specification". At
no point in this thread have I said "Don't deviate from the
specification"[1], only that you shouldn't try to fool yourself or others
into thinking that such code obeys the spec.
OK'
[1] The closest I've come to that is to say that it might be worth deviating
from the specification if you need to support IE 5.x. That's practically a
suggestion to do it!


With opacity (in order to support all 1yr old or younger UA'a) you have
to break specifications to support Safary, Konqueror, Firefox, IE +
some inspeakable pervertions for Opera.
"There is no value judgement involved in that statement" as you said.
Just the situation created without my participation, but which I have
to deal with.

Feb 21 '06 #20

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

Similar topics

2
by: Csaba2000 | last post by:
The following code has me so confused, I don't even know the right questions to ask. Opera 7.01 and IE 5.5 both exhibit behaviours I don't understand while NN 6.1 seems to ignore me altogether. ...
3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
3
by: Andrew Poulos | last post by:
Further to my hassles with IE5, I think I've narrowed (one of) the problems down to lines that try to set a cursor property. For example: obj.style.cursor = "pointer"; This code works in IE...
1
by: Jordan | last post by:
I set the cursor property to change to the "hand" when the user performs an "onmouseover" event on a hyperlink object. This does work correctly with Internet Explorer, however, with Netscape and...
4
by: =?Utf-8?B?Sm9hY2hpbQ==?= | last post by:
Am I not supposed to be able to set the current cursor by assigning Cursor.Current? this.Cursor in the main dialog works, but not Cursor.Current other components. I am using a third party tool...
1
by: mshankar | last post by:
hi, friends any one know the solution for how to set the image to a cursor in firefox using javascript i know to set this by using stylesheet cursor :url("ravishankar.cur"),pointer but using...
1
by: ryezack | last post by:
i have an image map with an onmouseover event thats calls a javascript function style cursor is hand. this works in IE but not in firefox. here's the code: <script type="text/javascript"> <!--...
4
by: datvong | last post by:
IE does not change the cursor immediately after a style.cursor is set. In the following sample, I have 2 divs, one inside another. The inner has a cursor of crosshair, outer a hand. If I click...
2
by: mukeshrasm | last post by:
hi this code this.style.cursor='hand'; does not work on firefox mozila so how can i do it?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.