Hi !
I'm trying to create a drop down menu like the one that you can find on this place http://www.ladygaga.com/default.aspx#!updates
Does anyone have a link to a good link or something to get me started? It's the drop down function ( the movemeent when you hold over the red bar at the top ) that I'm after.
01-05-2013, 02:57 PM
Sup3rkirby
Firstly, I notice you have 2 topics for this exact question. No need to do something like that even if you aren't sure of the category you should post in.
Now, while this effect could be done using CSS, for compatibility reasons it would be best suited for javascript. I suppose in the end it mainly depends on your target audience and the browser(s) they use. If IE users aren't a concern you could simply use some CSS to get this done using hover classes and transitions.
transition: all 2s;
-moz-transition: all 2s;
-webkit-transition: all 2s;
-o-transition: all 2s;
}
.topBar:hover {
top: 0px;
}
That's just a basic example, but the functionality works in the same manor. To be fair, this would technically work in versions of IE since :hover is supported, but the change would be instant, rather than a smooth and gradual effect over 2 seconds.
So if you are instead looking for a more universal setup that is compatible across the board, some simple javascript would be your aim. You'd essentially use the same CSS class to initially position your top element, but add 2 javascript listeners to hover over and out of the element, providing a smooth and gradual dropdown effect.