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 03-03-2006, 10:33 PM background img swap
jyoz22's Avatar
Ultra Talker

Posts: 278
Location: Orlando, FL
Trades: 0
i'm trying to change the background image of a cell with a onMouseOver command, i need something similar to onmouseover="style.backgroundColor='#000000';" but for an image. I've tried this onmouseover="style.background-image:url('img/hovlink.png')" but won't work any advice? (I need something compatible with most if not all browsers)
jyoz22 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-04-2006, 11:25 AM Re: background img swap
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
Is it possible to use a background image on your a:hover with css (instead of the cell)?

Something like
Code:
#nav a:link, #nav a:visited {
    background-image: url(link01.jpg);
     }

#nav a:hover {
     	background-image: url(hover01.jpg);
     }
... assuming it's a link because you used 'hovlink.png'...

Last edited by gringo; 03-04-2006 at 11:26 AM..
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 03-04-2006, 11:36 AM Re: background img swap
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
to use a hyphenated CSS property with DHTML you remove the hyphen "-" and then set the first letter of the second word to uppercase.
so background-image becomes
Code:
element.style.backgroundImage = "url(pic_path)"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-15-2008, 03:57 PM Re: background img swap
Junior Talker

Posts: 1
Trades: 0
Chris,

You are a god! Yours is the only post I could find on the internet which answered this.

Here's the final code:

Code:
onmouseover="style.backgroundImage='url(PageGifs/SelectedGrad.gif)'"
Xerxel
Xerxel is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to background img swap
 

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 0.19236 seconds with 12 queries