Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Problem with onmouseover



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
Asmodeux



Joined: 30 Apr 2008
Posts: 1

PostPosted: Wed Apr 30, 2008 5:42 pm    Post subject: Problem with onmouseover Reply with quote

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
View user's profile Send private message
rangana
250+ Club


Joined: 27 Feb 2008
Posts: 439
Location: Cebu City Philippines

PostPosted: Thu May 01, 2008 1:42 am    Post subject: Re: Problem with onmouseover Reply with quote

Your code is erroneous Wink
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 Wink
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap