HighDots Forums  

Hover effect for non-anchor tags

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Hover effect for non-anchor tags in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
CJM
 
Posts: n/a

Default Hover effect for non-anchor tags - 10-13-2003 , 06:57 AM






Is it possible to achieve a hover effect for a non-anchor tag in CSS?

I can use the following code, but it goes against the grain:
<a href="" onclick="return false;">Label</a>

Surely there must be a 'proper' way of doing it?

Thanks

Chris



Reply With Quote
  #2  
Old   
Steve Fulton
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 07:03 AM






CJM wrote:
Quote:
Is it possible to achieve a hover effect for a non-anchor tag in CSS?

I can use the following code, but it goes against the grain:
a href="" onclick="return false;">Label</a

Surely there must be a 'proper' way of doing it?
Just find a client that correctly implements the :hover pseudo-class for all
elements (hint: not IE).

--
Steve

It is curious that physical courage should be so common in the world and moral
courage so rare. -Mark Twain




Reply With Quote
  #3  
Old   
CJM
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 07:25 AM



Hmmm.... I had a horrible feeling this would be the answer....

This is an intranet system. Guess what our standard browser is....

Oh well....

CJM

"Steve Fulton" <cerberus40 (AT) hotmail (DOT) com> wrote

Quote:
CJM wrote:
Is it possible to achieve a hover effect for a non-anchor tag in CSS?

I can use the following code, but it goes against the grain:
a href="" onclick="return false;">Label</a

Surely there must be a 'proper' way of doing it?

Just find a client that correctly implements the :hover pseudo-class for
all
elements (hint: not IE).

--
Steve

It is curious that physical courage should be so common in the world and
moral
courage so rare. -Mark Twain





Reply With Quote
  #4  
Old   
Steve Fulton
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 08:37 AM



CJM wrote:
Quote:
Hmmm.... I had a horrible feeling this would be the answer....

This is an intranet system. Guess what our standard browser is....

Then you'd have more luck in a microsoft.* group.

You might be able to implement hover-like functionality in IE with a behavior.
<http://msdn.microsoft.com/workshop/author/behaviors/howto/using.asp>

--
Steve

The wise man learns more from his enemies than a fool does from his friends.
-Chinese proverb




Reply With Quote
  #5  
Old   
CJM
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 09:58 AM



No... I'm not prepared to do an IE-only page. My javascript solution depends
on J(ava)Script not being disabled in the browser, but at least it offers
some form of browser independance.

We are not about to declare Mozilla our standard browser, but at least we
wont be precluding it...

Cheers

Chris

"Steve Fulton" <cerberus40 (AT) hotmail (DOT) com> wrote

Quote:
CJM wrote:
Hmmm.... I had a horrible feeling this would be the answer....

This is an intranet system. Guess what our standard browser is....


Then you'd have more luck in a microsoft.* group.

You might be able to implement hover-like functionality in IE with a
behavior.
http://msdn.microsoft.com/workshop/a...owto/using.asp

--
Steve

The wise man learns more from his enemies than a fool does from his
friends.
-Chinese proverb





Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 11:31 AM



"CJM" <cjmwork (AT) yahoo (DOT) co.uk> wrote:

Quote:
My javascript solution depends
on J(ava)Script not being disabled in the browser, but at least it
offers some form of browser independance.
We don't even know the real problem, so we cannot estimate the adequacy
of the solution. What is the problem that you expect to solve with the
hover effect (which?) for a non-anchor element? Is there any reason why
the user would move the mouse over a normal innocent element?

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #7  
Old   
Barry Pearson
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 12:53 PM



Jukka K. Korpela wrote:
[snip]
Quote:
We don't even know the real problem, so we cannot estimate the
adequacy of the solution. What is the problem that you expect to
solve with the hover effect (which?) for a non-anchor element? Is
there any reason why the user would move the mouse over a normal
innocent element?
Perhaps, perhaps not. But ....

"Title" often causes a UA to display tooltips when hovering over "a normal
innocent element". IE 6, Firebird 0.6.1, Opera 7.2, and Netscape 7.1 all do
this when hovered over some of the cells of:
http://www.birdsandanimals.info/

I won't comment on whether this is good or bad. I'll simply suggest that some
consistency would be useful, and if tooltips can be shown, why not be able to
change other properties too?

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/




Reply With Quote
  #8  
Old   
William Tasso
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 04:33 PM



Jukka K. Korpela wrote:
Quote:
...
Is there any reason why the user would move the mouse over a
normal innocent element?
torment - the pursuit of joy at the expense of anothers pain.

--
William Tasso - http://WilliamTasso.com




Reply With Quote
  #9  
Old   
kchayka
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-13-2003 , 11:02 PM



Jukka K. Korpela wrote:
Quote:
Is there any reason why
the user would move the mouse over a normal innocent element?
It may likely happen by accident, while moving the mouse to some
unrelated item on the screen, maybe even in the window of another app
altogether.

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.



Reply With Quote
  #10  
Old   
CJM
 
Posts: n/a

Default Re: Hover effect for non-anchor tags - 10-14-2003 , 06:56 AM



The hover effect will be used in a javascript menu on our intranet. It is
to give the users the impression that menu categories *are* links and thus
can be clicked!

The menu is in a frameset, with other IE-only tweaks.

There are other horrors too...

You (the 'purists') could point out all sorts of problems with our setup
here, however I think it would be unfair to kick a man when he is down.

Outside work, I'm creating an accessible & standards-compliant website for a
charity. In work, I'm am being coerced in to creating a frankenstein's
monster of an intranet.

I know I'm not a purist, and I bend a few rules from time to time, but I'm
better than this.

Chris

"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> wrote

Quote:
"CJM" <cjmwork (AT) yahoo (DOT) co.uk> wrote:

My javascript solution depends
on J(ava)Script not being disabled in the browser, but at least it
offers some form of browser independance.

We don't even know the real problem, so we cannot estimate the adequacy
of the solution. What is the problem that you expect to solve with the
hover effect (which?) for a non-anchor element? Is there any reason why
the user would move the mouse over a normal innocent element?

--
Yucca, http://www.cs.tut.fi/~jkorpela/



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.