jQuery中animate用法實例分析
更新時間:2015年03月09日 10:07:52 作者:瘋狂的流浪
這篇文章主要介紹了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程序設計有所幫助。
您可能感興趣的文章:
相關文章
jQuery中filter()和find()的區(qū)別深入了解
一直不是很清楚filter()方法和find()方法的區(qū)別,看jQuery Cookbook一書后,終于算是搞清楚了,下面將新的與大家分享下2013-09-09jQuery實現(xiàn)動態(tài)添加tr到table的方法
這篇文章主要介紹了jQuery實現(xiàn)動態(tài)添加tr到table的方法,涉及jQuery針對table表格元素的動態(tài)操作相關技巧,需要的朋友可以參考下2016-12-12