jQuery中animate用法實例分析

字號:


    這篇文章主要介紹了jQuery中animate用法,實例分析了animate的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    本文實例講述了jQuery中animate用法。分享給大家供大家參考。具體如下:
    這是一個簡單的animate函數(shù)嘗試。代碼如下:
    <script type="text/javascript">
    $(document).ready(function(){
    $(".side-box h3").toggle(function(){
    $(this).addClass("box-arrow");
    $(this).next(".side-text").animate({
    height: 'toggle',
    opacity: 'toggle'
    }, "slow");
    return false;
    },function(){
    $(this).next(".side-text").animate({
    height: 'toggle',
    opacity: 'toggle'
    }, "slow");
    $(this).removeClass("box-arrow");
    return false;
    });
    });
    </script>
    希望本文所述對大家的jQuery程序設計有所幫助。