jQuery中animate用法實(shí)例分析

字號(hào):


    這篇文章主要介紹了jQuery中animate用法,實(shí)例分析了animate的使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    本文實(shí)例講述了jQuery中animate用法。分享給大家供大家參考。具體如下:
    這是一個(gè)簡(jiǎn)單的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>
    希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。