一款利用jQuery實現的折疊層,點擊收縮和展開效果,默認情況下是展開的,主要是用JavaScript代碼定義的,在此提示,第一次運行請刷新一下頁面,讓遠程的jQuery插件載入。
為解決一些網頁特效運行后不能顯示效果(例如:jQuery則需要刷新)問題,特別新增網頁版演示。
點擊查看:網頁特效
運行演示:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=gbk" /><title>jquery 收縮展開效果</title><script type="text/javascript" src="/uploads/common/js/jquery-1.4.2.min.js"></script><style>/* 收縮展開效果 */.text{line-height:22px;padding:0 6px;color:#666;}.box h1{padding-left:10px;height:22px;line-height:22px;background:#f1f1f1;font-weight:bold;}.box{position:relative;border:1px solid #e7e7e7;}h1{font-size:16px;}</style></head><body><script type="text/javascript">// 收縮展開效果$(document).ready(function(){$(".box h1").toggle(function(){$(this).next(".text").animate({height: 'toggle', opacity: 'toggle'}, "slow");},function(){$(this).next(".text").animate({height: 'toggle', opacity: 'toggle'}, "slow");});});</script><!-- 收縮展開效果 --><div class="box"><h1>收縮展開效果</h1><div class="text">1<br />2<br />3<br />4<br />5<br /></div></div><br /><div class="box"><h1>收縮展開效果</h1><div class="text">1<br />2<br /></div></div><br>第一次運行請刷新一下頁面。</body></html><div style="text-align:center;margin:30px 0 0 0;"><hr style="color:#999;height:1px;">如不能顯示效果,請按Ctrl+F5刷新本頁,更多網頁代碼:<a href='http://www.vxbq.cn/' target='_blank'>http://www.vxbq.cn/</a></div>提示:可修改后代碼再運行!
上一篇 在SQL SERVER 2005中使用分區表技術
下一篇 藍杉丘仕達:原創文章的一些思考
程序員人生,我編程,我富裕,記住wfuyu網,php教程,php學習,php手冊,CMS模版制作
聲明:本站大部分內容是作者原創,少部分收集于互聯網供大家一起學習,原版權很多不明,如有侵權請聯系本站,謝謝!
粵ICP備14040726號-1?? 2015-2020 程序員人生 版權所有