Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 07-21-2010, 04:26 PM Remove hover
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Short question:

Is there a way to remove hover effects?

Let's say I have this:

Code:
.divclass {
background:red;
}
.divclass:hover{
background:blue;
}
A red div that turns blue when you hover over it. But let's say I want there to be a type (attribute) that removes the hover for only some of the divclass classes: like so:

Code:
[type=nohover]:hover {
background:none;
}
But that doesn't work very well, I want it to be red. I could just put red in there, but that doesn't make it universal for any class or div.

How can I make it so that it it?

Thanks

-PG
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-21-2010, 05:54 PM Re: Remove hover
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Have a look at advanced attribute selectors
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-21-2010, 07:52 PM Re: Remove hover
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Oooo pretty

Thanks!
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 07-22-2010, 06:16 PM Re: Remove hover
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Can I do a CSS if?

Like this:

If ([type!=nohover]){
//hover stuff
}

That way only things without nohover will get a hover effect; those without will not.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 07-23-2010, 04:29 AM Re: Remove hover
Registered User

Posts: 86
Name: John Dacu
Trades: 0
Why don't you reset the css for hover element like normal state: background: red;?
johnny.dacu is offline
Reply With Quote
View Public Profile
 
Old 07-23-2010, 06:45 PM Re: Remove hover
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Because I wanted it to work for different classes, too.

Basically I want type=nohover to disregard the :hover pseudoclass for that element.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Remove hover
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.27108 seconds with 12 queries