CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 8th, 2004, 12:00 PM
solid solid is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: :::
Posts: 10 solid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
using css class to handle events

is there a way I can do something similar to this?

.myClass {
onMouseOver: background: #000080
onMouseOut: background: #ffffff
}

I would like to have css classes that encapsulate all of the event handlers that I need to reduce the redundant html in my pages.

thanks,

david

Reply With Quote
  #2  
Old January 8th, 2004, 12:33 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,685 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 4 Weeks 6 h 17 m 10 sec
Reputation Power: 594
in standard compliant browsers you can use the pseudo-class hover on any element.

.myClass {
background: #ffffff;
}

.myClass:hover {
background: #000080;
}

ie.
<p class="myClass">

Reply With Quote
  #3  
Old January 8th, 2004, 01:34 PM
solid solid is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: :::
Posts: 10 solid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for your reply.

can handle events like onclick and blur in a similar manner?

Reply With Quote
  #4  
Old January 15th, 2004, 09:45 AM
bobson's Avatar
bobson bobson is offline
7-1 underdog
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 14 bobson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy CSS event handling

I've been searching for the answer to this too, but it looks like unfortunately Microsoft Internet Explorer (my browser, and let's face it, almost everybody elses) can't handle :hover on anything but the <a> tag.

This means if you're doing a page with multiple rollover images (a menu for instance) you will have to add a javascript "onMouseOver" event handler to every (yawn) image tag you want to react to mouseOver.

Fortunately, IE offers HTC behaviors, which offer amazing functionality and event handling, but I'm a bit suspicious that Netscape and co might not be able to use them.

Any high level users listening who can add to this?

bob

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > using css class to handle events


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT