Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS3 Scale Animation Keyframes

having a few issues using css3 animation scale, opacity and other things work but cant seem to get scale to work.

snippet:

    #treeLeaves {
        background: url(https://i.pinimg.com/originals/72/c0/8e/72c08eefa235ae1c8aa72caa71eeba39.jpg);
        background-repeat:no-repeat;
        width:100%;
        height:375px;
        z-index:5;
        position:absolute;
        bottom:140px;
        left:0px;
    }

    @keyframe leaves {
        0% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);
        }
        100% {
            transform: scale(2.0);
            -webkit-transform: scale(2.0);
        }
    }

    #treeLeaves {
        animation: leaves 5s ease-in-out infinite alternate;
        -webkit-animation: leaves 5s ease-in-out infinite alternate;
    }
<div id="treeLeaves"></div>
<div class="leaves">

basically its 1 img that i wanted to scale up and down constantly over time. only using webkit because it only needs to work in chrome.

thanks.

like image 435
Nicholas Ritson Avatar asked Jul 20 '13 23:07

Nicholas Ritson


People also ask

What is the difference between keyframes and Webkit keyframes?

You first describe the animation effect using the @-webkit-keyframes rule. A @-webkit-keyframes block contains rule sets called keyframes. A keyframe defines the style that will be applied for that moment within the animation.

What is @- webkit keyframes in CSS?

The @keyframes rule specifies the animation code. The animation is created by gradually changing from one set of CSS styles to another. During the animation, you can change the set of CSS styles many times.

How do you scale property in CSS3?

The scale() CSS function defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result is a <transform-function> data type.


1 Answers

I think you forgot the 's' in keyframes. try @keyframes and @-webkit-keyframes.

like image 57
Brice Lin Avatar answered Sep 19 '22 03:09

Brice Lin