css3 animation jitter effect_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:49:04
Original
1937 people have browsed it

html结构:



css样式:

.dd {

    animation: shake 1s;
    -o-animation: shake 1s;
    -webkit-animation: shake 1s;
    -moz-animation: shake 1s;
}
@keyframes shake {
    0%, 100% {
        -webkit-transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        -webkit-transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        -webkit-transform: translateX(5px);
    }
}
@-o-keyframes shake {
    /* Opera */
    0%, 100% {
        -webkit-transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        -webkit-transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        -webkit-transform: translateX(5px);
    }
}
@-webkit-keyframes shake {
    /* Safari 和 Chrome */
    0%, 100% {
        -webkit-transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        -webkit-transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        -webkit-transform: translateX(5px);
    }
}
@-moz-keyframes shake {
    /* Firefox */
    0%, 100% {
        -moz-transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        -moz-transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        -moz-transform: translateX(5px);
    }

}


js效果:



效果:


鼠标经过home图标时,图标会左右晃动。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template