| View previous topic :: View next topic |
| Author |
Message |
Asmodeux
Joined: 30 Apr 2008 Posts: 1
|
Posted: Wed Apr 30, 2008 5:42 pm Post subject: Problem with onmouseover |
|
|
I want to do a simple onmouseover with a div. So I have the following code
<div onmouseover="this.style.background='."'#0F0'".';"...
But it triggers a JS error.
My ultimage goal is to change the background image on mouseover and mouseout.
I dont' want to do this with CSS styles as this doesn't work will IE. |
|
| Back to top |
|
 |
|
|
rangana 250+ Club

Joined: 27 Feb 2008 Posts: 439 Location: Cebu City Philippines
|
Posted: Thu May 01, 2008 1:42 am Post subject: Re: Problem with onmouseover |
|
|
Your code is erroneous
It should be:
| Code: |
<div onmouseover="this.style.background='#0f0';">
|
This example below lets you work with images too as well as your text colors:
| Code: |
<div style="height:400px;width:300px;" onmouseover="this.style.background='#f00';" onmouseout="this.style.background='url(http://www.sciam.com/media/externalnews/2008-04-23T225027Z_01_NOOTR_RTRIDSP_2_TECH-GOOGLE-ADVERTISING-DC.jpg)';this.style.color='#fff';">
Raymond Angana
</div>
|
See if it helps  |
|
| Back to top |
|
 |
|