欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery實(shí)現(xiàn)簡(jiǎn)單合攏與展開網(wǎng)頁面板的方法

 更新時(shí)間:2015年09月01日 10:49:21   作者:企鵝  
這篇文章主要介紹了jquery實(shí)現(xiàn)簡(jiǎn)單合攏與展開網(wǎng)頁面板的方法,通過簡(jiǎn)單的jquery頁面元素樣式操作實(shí)現(xiàn)展開與合攏面板的功能,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下

本文實(shí)例講述了jquery實(shí)現(xiàn)簡(jiǎn)單合攏與展開網(wǎng)頁面板的方法。分享給大家供大家參考。具體如下:

這是一款網(wǎng)頁上常見的合攏(收縮)、伸展面板代碼,使用了jQuery插件,代碼更加簡(jiǎn)化,點(diǎn)擊面板的標(biāo)題欄即可折疊、或展開這個(gè)層,是網(wǎng)上很流行的效果,由此可擴(kuò)展出的功能還真挺多,只要?jiǎng)幽X筋,一定能做出來。

運(yùn)行效果截圖如下:

在線演示地址如下:

http://demo.jb51.net/js/2015/jquery-simple-hidden-show-web-table-codes/

具體代碼如下:

<!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=utf-8" />
<title>網(wǎng)頁上的層收縮、伸展面板代碼</title>
<style type="text/css">
*{margin:0;padding:0;} 
body { font-size: 13px; line-height: 130%; padding: 60px }
#panel { width: 300px; border: 1px solid #0050D0 }
.head { padding: 5px; background: #96E555; cursor: pointer }
.content { padding: 10px; text-indent: 2em; border-top: 1px solid #0050D0;display:block; }
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
 $("#panel h5.head").toggle(function(){
  $(this).next("div.content").hide();
 },function(){
  $(this).next("div.content").show();
 })
})
</script>
</head>
<body>
<div id="panel">
 <h5 class="head">點(diǎn)擊此處標(biāo)題可展開</h5>
 <div class="content">
  一款基于jquery的伸展面板代碼,點(diǎn)擊面板的標(biāo)題欄即可折疊、或展開這個(gè)層,貌似網(wǎng)上很流行的效果,引用了jQuery插件,使得本款效果更加的簡(jiǎn)潔實(shí)用, </div>
</div>
</body>
</html>

希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論