By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
19 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.