麻烦简单的动画

时间:2016-12-29 17:10:25

标签: javascript jquery css animation toggle

此代码仅适用于JSfiddle。

http://jsfiddle.net/KhcvR/2016/

$(".sort").toggle(function() {
    $(".sort").animate({
        width: '90%'
    });
}, function() {
    $(".sort").animate({
        width: '50px'
    });
});
.sort {
    width: 50px;
    height: 50px;
    background-color: #EA932E;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<div class="sort"></div>

0 个答案:

没有答案