I
I
Ilya Korablev2015-03-09 15:12:18
css
Ilya Korablev, 2015-03-09 15:12:18

Animation when opening a page?

Hello everybody!
I'll give you an example right away .
How can I make it so that the animation is when the page is opened, and not after hovering over?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vahe, 2015-03-09
@swipeshot

You need to use animation propertiesanimation-delay

-webkit-animation-delay: 2s; /* Chrome, Safari, Opera */
 animation-delay: 2s;

This defines the animation delay The animation
delay value is specified in seconds (s) or milliseconds (ms).
If you assign -2sthe animation will start immediately 2 seconds later.
I don't know I was able to explain well, see this example. .Even the example you provided animation starts on hover there is a block <div></div>
assign
div {
    width: 100px;
    height: 100px;
    background: red;
    position: relative;
    -webkit-animation: mymove 2s infinite; /* Chrome, Safari, Opera */
    -webkit-animation-delay: none; /* Chrome, Safari, Opera */
    animation: mymove 2s infinite;
    animation-delay: none;
}

/* Chrome, Safari, Opera */
@-webkit-keyframes mymove {
    from {left: 0px;}
    to {left: 200px;}
}

@keyframes mymove {
    from {left: 0px;}
    to {left: 200px;}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question