Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Transitions

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33385
    TT_Mark
    Member

    I’m trying something different with CSS Animations.

    Basically when the page loads, I want a 2 second delay before an element fades in. Currently I have it triggering when the user hovers over the body as below. But obviously, when the user moves the cursor out of the body, the logo disappears again..

    I don’t really know what I’m doing!


    body {
    background: #000;
    height: 100%;
    }
    body:hover #logo {
    opacity: 1;
    -webkit-transition: opacity 2s ease-in-out 1s;
    }

    #logo {
    opacity: 0;
    }

    #82885
    TheDoc
    Member

    If it’s on page load, might as well roll out some jQuery I think.

    #82890
    TheDoc
    Member

    I think you had a pretty good idea, and for the most part it would work – but that time when the user isn’t hovered over the body it could look weird.

    #110546
    ianp
    Member

    the transition should be in the default state not the hover

    body {
    background: #000;
    height: 100%;
    -webkit-transition: opacity 2s ease-in-out 1s;
    }

    body:hover #logo {
    opacity: 1;
    }

    #logo {
    opacity: 0;
    }

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.