newbie question on mouse hand and css

J

Jacques Koorts

is cursor:pointer; correct css? my css editor doesnt like it. also I've got
this :

<a onclick="opencomment()">Add story</a>

Now when i put the mouse over it, the hand does not appear anymore

<a style="cursor:pointer;" onclick="opencomment()">Add story</a>

Ok now that problem is solved but when i click my computer does not make
that click sound it does when clicking on ordinary links

Have I got it all wrong here?

cheers
jk
 
N

Nik Coughin

Jacques said:
is cursor:pointer; correct css? my css editor doesnt like it. also
I've got this :

<a onclick="opencomment()">Add story</a>

Now when i put the mouse over it, the hand does not appear anymore

<a style="cursor:pointer;" onclick="opencomment()">Add story</a>

Ok now that problem is solved but when i click my computer does not
make that click sound it does when clicking on ordinary links

Have I got it all wrong here?

cheers
jk

Try <a href="javascript:void" onclick="opencomment()"> instead. Then it
will treat it like a real link, without it going anywhere. No need to use
your pointer style then.
 
M

mscir

Jacques said:
is cursor:pointer; correct css? my css editor doesnt like it. also I've got
this :

<a onclick="opencomment()">Add story</a>

Now when i put the mouse over it, the hand does not appear anymore

<a style="cursor:pointer;" onclick="opencomment()">Add story</a>

Ok now that problem is solved but when i click my computer does not make
that click sound it does when clicking on ordinary links

Have I got it all wrong here?

cheers
jk

I read that this is a good idea, not sure what browser versions it
applies to presently though:

a {cursor: pointer; cursor: hand;}

http://devedge.netscape.com/viewsource/2002/cursor/

Mike
 
M

mscir

Jacques said:
is cursor:pointer; correct css? my css editor doesnt like it. also I've got
this :

<a onclick="opencomment()">Add story</a>

Now when i put the mouse over it, the hand does not appear anymore


I forgot to mention that you'll get the hand cursor for your anchor
using this, the "#" causes the page to reload:

<a href="#" onclick="opencomment()">Add story</a>

Mike
 
M

Mark Parnell

the "#" causes the page to reload:
<a href="#" onclick="opencomment()">Add story</a>

No, it takes you to the top of the page. It won't actually reload (not
on any browser I know of anyway).
 
M

Mark Parnell

<a onclick="opencomment()">Add story</a>

And what happens for those who don't have Javascript enabled/available?
Absolutely nothing.
Now when i put the mouse over it, the hand does not appear anymore

Because it isn't a link.
when i click my computer does not make
that click sound it does when clicking on ordinary links

Because it isn't a link.
Have I got it all wrong here?

Yes. Let links be links. Don't use Javascript if you want it to work for
everyone - IOW, only use it for optional extras.

If you must:

<a href="comment.html" onclick="opencomment(); return false;">Add
story</a>

Then your Javascript function will fire for those who have Javascript,
and anyone else will be taken to comment.html like a normal link.
 
W

Weyoun the gowd damn Dominion Vorta who certainly

Mark said:
No, it takes you to the top of the page. It won't actually reload (not
on any browser I know of anyway).


to make it reload:

<a href="page.ext"...
 
J

Jacques Koorts

Mark,

I needed to have opencomment() do the customized popup window.

I'm sorry for those who do not have javascript enabled.

its more a hobby site, and not corporate.

thanks for the help guys. Just one question on top of this one,

Is <a href="javascript:void" onclick="opencomment()"> really the only way to
display a popup window, without the current page doing a reload?

Its kinda strange if this is the case.
 
T

Toby A Inkster

Jacques said:
Is <a href="javascript:void" onclick="opencomment()"> really the only way to
display a popup window, without the current page doing a reload?

Best way - in the document head:

<script type="text/javascript">
function openpop(u,t) {
p = window.open(u,t,"scrollbars=yes,resizable=yes,status=yes,height=240,width=320");
}
</script>

and then links like this:

<a href="somefile" target="sometarget"
onclick="openpop(this.href,this.target);return false;">Some Text</a>
 
K

Keeper

or

<a href="JavaScript:page.Reload()">

and this works in all java enabled browsers.. (pretty much all)

Later,
Keeper


"Weyoun the gowd damn Dominion Vorta who certainly didn't dance"
 
T

Toby A Inkster

Keeper said:
<a href="JavaScript:page.Reload()">

and this works in all java enabled browsers.. (pretty much all)

No it doesn't. It works on *many* *Javascript* enabled browsers. (Somewhat
more than half, but significantly less than all.)
 
M

Mark Parnell

<a href="JavaScript:page.Reload()">

Excellent. An unreliable solution in place of a reliable solution. Great
idea.
and this works in all java enabled browsers.. (pretty much all)

Javascript != Java

Assuming you mean Javascript, most estimates say that around 10-15% of
users have Javascript disabled. I wouldn't call 85-90% *pretty much*
all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top