Solved

CSS effect to show and hide div

Posted on 2014-04-17
3
1,151 Views
Last Modified: 2014-04-21
Hi all,

If you see this page: http://www.avast.com and mouseover the "Business" option on top, a menu underneath the top menu will show up, and it will show up sort of like in "slow motion"... if you mouseout, it disapears.

 I tried to do the same by showing and hiding a DIV like this:

onmouseover="document.getElementById('SubMenu').style.display = 'block';"
onmouseout="document.getElementById('SubMenu').style.display = 'none';"

This is what I have on the DIV

<div id="SubMenu" style="display:none;">            
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="150">&nbsp;</td>
  </tr>
</table>
</div>    

But it just shows and hide, which is fine.

My question is, how can I add that "motion" effect for the DIV to show up slowly instead of just show and hide?

Thanks.
0
Comment
Question by:SimpleDude
3 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 350 total points
ID: 40007934
I think it will be easier to  use one of the jquery animations http://api.jquery.com/slideDown/
0
 
LVL 10

Assisted Solution

by:Jeffrey Dake
Jeffrey Dake earned 150 total points
ID: 40008141
Slide Toggle is also a good choice if you are trying to close and open something.

http://api.jquery.com/slideToggle/
0
 

Author Closing Comment

by:SimpleDude
ID: 40012851
Thanks guys
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now