Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-webkit-transition with display

Is there a way to use -webkit-transition with display?

I'm using CSS display to hide and show a navigations second level … but only display: none and display: block on :hover is a little un-sexy… a ease would be great (like -webkit-transition: display 300ms ease-in;)

I know that's fairly easy to do this with jQuery, but I'm currently trying to setup everything with CSS3 (i know: not all browsers do support it, but that's irrelevant for this one project I'm currently working on)

here's some code & structure: (the li.menu1 has a :hover with section.nav-menu1 {display: block;})

<ul>
    <li class="menu1"><a href="#">Menu 1</a>
        <section class="nav-menu1">
            <h1 class="none">Level 2 Overlay</h1>
            <nav>
                <h2 class="none">Menu 1 Navigation</h2>
                <ul>
                    <li><a href="#">Menu 1 Level 2-1</a></li>
                    <li><a href="#">Menu 1 Level 2-2</a></li>
                    <li><a href="#">Menu 1 Level 2-3</a></li>
                </ul>
            </nav>
        </section>
    </li>
</ul>
like image 711
albuvee Avatar asked Nov 14 '10 17:11

albuvee


People also ask

How do you use display in a sentence?

Examples of display in a SentenceToys were displayed in the store window. Her awards are prominently displayed on the mantel.

What is another way of saying display?

Some common synonyms of display are exhibit, expose, flaunt, parade, and show. While all these words mean "to present so as to invite notice or attention," display emphasizes putting in a position where others may see to advantage.

What is the meaning of on display?

Definition of on display : put somewhere for people to see : in a display Autographed baseballs are on display at the show. Only a few of the artifacts will go on display.

What is this word display?

to show or exhibit; make visible: to display a sign. to reveal; betray: to display fear. to unfold; open out; spread out: to display a sail.

What is the meaning of display in a sentence?

Kids Definition of display. 1 : to put (something) in plain sight The store displays toys in its window. 2 : to make clear the existence or presence of : show plainly display anger She displayed a gift for acting.

What is the use of display property?

Definition and Usage The display property specifies the display behavior (the type of rendering box) of an element. In HTML, the default display property value is taken from the HTML specifications or from the browser/user default style sheet. The default value in XML is inline, including SVG elements.

What is the difference between display and exhibit?

While all these words mean "to present so as to invite notice or attention," display emphasizes putting in a position where others may see to advantage. When is exhibit a more appropriate choice than display? While the synonyms exhibit and display are close in meaning, exhibit stresses putting forward prominently or openly.

What is the synonym of display?

Synonyms for display. Choose the Right Synonym for display. show, exhibit, display, expose, parade, flaunt mean to present so as to invite notice or attention. show implies no more than enabling another to see or examine.


1 Answers

So I'm not sure I see all the pieces put together here. You want to animate opacity and visibility, with visibility having a delay so opacity is done before it triggers;

opacity: 0;
-moz-transition: opacity .25s linear, visibility .1s linear .5s;
-webkit-transition: opacity .25s linear, visibility .1s linear .5s;
-o-transition: opacity .25s linear, visibility .1s linear .5s;
transition: opacity .25s linear, visibility .1s linear .5s;
visibility: hidden;

to

opacity: 1;
visibility: visible;

visibility will wait .5s and then switch over to hidden. You can even turn off the visibility transition on one side if you want it to fade both ways. (So that when fading in, the element is instantly visible instead of waiting .5s and transitioning.)

like image 159
Bob Spryn Avatar answered Sep 30 '22 18:09

Bob Spryn