Jump to content
xisto Community
Sign in to follow this  
Creon

Div Opacity On Mouseover what am I doing wrong?

Recommended Posts

So I'm trying to build a website with a menu that's in a transparent div on pageload, and switches to a more visible style on mouseover. I got the div on an opacity 25 by default, and it switches to 75 on mouseover, yet it doesn't seem to jump back to 25 when the mouse leaves the div. Anyone got any idea what I'm doing wrong?


CSS:

div.transON {width: 100%; background-color: silver;opacity:.75;filter: alpha(opacity=75); -moz-opacity: 0.75;border:1px solid black; }div.transOFF {width: 100%; background-color: silver;opacity:.25;filter: alpha(opacity=25); -moz-opacity: 0.25;border:1px solid black; }

HTML:
<div class="transOFF" onmouseover="this.className='transON'" onmousout="this.className='transOFF'"><p style="padding:5px;width:75%;">This div should be transparent, until you move your mouse over it.</p></div>

Share this post


Link to post
Share on other sites

You've missed an 'e' off mouse :D

 

<div class="transOFF" onmouseover="this.className='transON'" onmouseout="this.className='transOFF'"><p style="padding:5px;width:75%;">This div should be transparent, until you move your mouse over it.</p></div>

Surely it isn't that simple?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.