代码拉取完成,页面将自动刷新
同步操作将从 缪斯的情人/Puerh 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JavaScript Plugins > Puerh - 百姓网 UI 库</title>
<link rel="stylesheet" href="stylesheets/base.css" />
<link rel="stylesheet" href="style.css" />
<!--[if lt IE 9]>
<script type="text/javascript">
// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector
/*@cc_on(function(a,b){function r(a){var b=-1;while(++b<f)a.createElement(e[b])}if(!(!window.attachEvent||!b.createStyleSheet||!function(){var a=document.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d<e){f=a[d];if(f.disabled)continue;b=f.media||b,p.test(b)&&g.push(c.getCSS(f.imports,b),f.cssText),b="all"}return g.join("")},c.parseCSS=function(a){var b=[],c;while((c=j.exec(a))!=null)b.push(((i.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(g,"$1.iepp_$2")+c[4]);return b.join("\n")},c.writeHTML=function(){var a=-1;q=q||b.body;while(++a<f){var c=b.getElementsByTagName(e[a]),d=c.length,g=-1;while(++g<d)c[g].className.indexOf("iepp_")<0&&(c[g].className+=" iepp_"+e[a])}k.appendChild(q),l.appendChild(n),n.className=q.className,n.id=q.id,n.innerHTML=q.innerHTML.replace(h,"<$1font")},c._beforePrint=function(){o.styleSheet.cssText=c.parseCSS(c.getCSS(b.styleSheets,"all")),c.writeHTML()},c.restoreHTML=function(){n.innerHTML="",l.removeChild(n),l.appendChild(q)},c._afterPrint=function(){c.restoreHTML(),o.styleSheet.cssText=""},r(b),r(k);if(c.disablePP)return;m.insertBefore(o,m.firstChild),o.media="print",o.className="iepp-printshim",a.attachEvent("onbeforeprint",c._beforePrint),a.attachEvent("onafterprint",c._afterPrint)}})(this,document)@*/
</script>
<![endif]-->
</head>
<body class="javascript">
<div class="container clearfix">
<div id="header" class="grid grid-20">
<div class="grid grid-4 first">
<h1 id="logo">Puerh</h1>
<strong id="tagline">百姓网 UI 库</strong>
</div>
<div class="grid grid-11 navi">
<a href="./index.html" id="index">HOME</a>
<a href="./css.html" id="css">CSS</a>
<a href="./javascript.html" id="javascript">JavaScript</a>
<a href="./getting-start.html" id="getting-start">Getting Start</a>
</div>
<div class="grid grid-5 last navi">Feedback:
<a href="http://arch.baixing.com/Puerh/faq.html">FAQ</a>
<a href="mailto:sundengjia@baixing.com">@登甲</a>
<a href="mailto:linjianfeng@baixing.com">@小鱼</a>
</div>
</div> <!-- #header -->
<p class="grid grid-20">
目前 Puerh 的大部分组件都使用 Twitter Bootstrap 库的自定义 Javascript 插件。删除了其中网站不常用的 Carousel 等组件,修改 Tips、Modals 等插件以适合百姓网需求,增加 Validator 和 Linkage 组件。
</p>
<table class="document-table" id="plugin-table">
<tr>
<th><a href="#Modals">Modals(弹出层)</a></th>
<th><a href="#Dropdowns">Dropdowns(下拉菜单)</a></th>
<th><a href="#Tabs">Tabs(标签切换)</a></th>
<th><a href="#Tips">Tips(浮层提示条)</a></th>
</tr>
<tr>
<th><a href="#Alert">Alert(可关闭消息)</a></th>
<th><a href="#Typeahead">Typeahead(自动完成)</a></th>
<th><a href="#Scrollspy">Scrollspy(滚动生成)</a></th>
<th><a href="#Collapse">Collapse(折叠)</a></th>
</tr>
<tr>
<th><a href="#Validator">Validator(表单验证)</a></th>
<th>Linkage(联动操作)</th>
<th></th>
<th></th>
</tr>
<tr>
<td colspan="4" class="table-ps"><small>注:API 接口使用可以参考:http://twitter.github.com/bootstrap/javascript.html</small></td>
</tr>
</table>
<div id="document" class="grid grid-20">
<div class="document-cell">
<h3 id="Modals" class="typo-h3"># Modals(弹出层)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<pre class="prettyprint">
$('#myModal').modal(Options);
</pre>
<p><strong>演示:</strong><button data-toggle="modal" data-target="#myModal">demo</button></p>
<h4 class="typo-h4">二、Options 对象</h4>
<p>Modal 只有唯一的方法:<code>.modal(Options)</code>。传入的 Options 可以是对象,也可以是字符串。当传入的 Options 是对象时,使用下面的属性:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>backdrop</td>
<td>boolean</td>
<td>true</td>
<td>当 options 中设置 <code>backdrop: 'static'</code> 时,点击背景的时候,不会关掉弹出框。设置为 <code>false</code> 的时候是不显示背景,不要混淆。</td>
</tr>
<tr>
<td>keyboard</td>
<td>boolean</td>
<td>true</td>
<td>是否允许用 Esc 键来关掉弹出框。</td>
</tr>
<tr>
<td>show</td>
<td>boolean</td>
<td>true</td>
<td>初始化时显示弹出框。</td>
</tr>
</tbody>
</table>
<p>当传入的 Options 是字符串时,传入内容的用法如下:</p>
<table>
<thead>
<tr>
<th>{String} Name</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>toggle</td>
<td>反复手动触发弹出层的打开/关闭。</td>
</tr>
<tr>
<td>hide</td>
<td>手动隐藏弹出层。</td>
</tr>
<tr>
<td>show</td>
<td>手动打开弹出层。</td>
</tr>
</tbody>
</table>
<h4 class="typo-h4">三、HTML 标记:</h4>
<p>在触发弹出框的元素添加 <code>data-toggle="modal"</code>,添加 <code>data-target="#弹出框ID"</code> 或 <code>href="弹出框ID"</code> 来指定弹出框。如:</p>
<pre class="prettyprint">
<button data-toggle="modal" data-target="#myModal">demo</button>
// 目标
<div class="fade hide" id="myModal">
<a data-dismiss="modal" class="close">×</a>
hello world
</div>
</pre>
<p>如果想让弹出框有动画效果,只需要给目标元素添加 <code>.fade</code> 这个 class,如上代码所示。</p>
<h4 class="typo-h4">四、支持事件</h4>
<table>
<thead>
<tr>
<th>Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>show</td>
<td>使用 <code>show</code> 显示弹出层的时候,事件被触发。</td>
</tr>
<tr>
<td>shown</td>
<td>当弹出层可见的时候,事件被触发。不一定是由 <code>show</code> 触发,可能是 <code>toggle</code></td>
</tr>
<tr>
<td>hide</td>
<td>使用 <code>hide</code> 隐藏弹出层的时候,事件被触发。</td>
</tr>
<tr>
<td>hidden</td>
<td>当弹出层不可见的时候,事件被触发。不一定是由 <code>hide</code> 触发,可能是 <code>toggle</code></td>
</tr>
</tbody>
</table>
<pre class="prettyprint">
// 事件示例代码
$('#myModal').on('hidden', function () {
// do something…
})
</pre>
</div>
</div> <!-- .document-cell #Modals-->
<div class="document-cell">
<h3 id="Dropdowns" class="typo-h3"># Dropdowns(下拉菜单)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<p>有两种方法,一种是使用 javascript 来设置:</p>
<pre class="prettyprint">
$('.dropdown-toggle').dropdown()
</pre>
<p>另一种方法是,使用 html 标记来直接设置:</p>
<div class="topbar clearfix">
<div class="topbar-left">
text place on the left side
</div> <!-- topbar-left -->
<div class="topbar-right">
<a href="#">注册</a> |
<a href="#">登录</a> -
<a href="#">用户中心</a>
<div class="dropdown dropdown-unibody" id="mydropdown2">
<a href="#mydropdown2" hidefocus data-toggle="dropdown" class="dropdown-trigger dropdown-trigger-active">消息<cite>8</cite><i class="arrow arrow-down"></i></a>
<ul class="dropdown-menu clearfix">
<li class="dropdown-menu-item"><cite>5</cite>条留言信息</li>
<li class="dropdown-menu-item"><cite>3</cite>条出价信息</li>
</ul>
</div>
<a href="#">付费推广</a> -
<a href="#">帮助</a> -
<a href="#">手机版</a>
</div> <!-- topbar-right -->
</div> <!-- .topbar -->
<h4 class="typo-h4">二、HTML 标记:</h4>
<p>在触发下拉框需要添加 <code>data-target="#下拉框ID"</code> 或 <code>href="下拉框ID"</code> 来指定下拉框。如:</p>
<pre class="prettyprint">
<ul>
<li id="#myDropdown"><button data-toggle="dropdown" data-target="#myDropdown">dropdown</button>
<ul class="dropdown-menu">
<li><a href="#">item 1</a></li>
<li><a href="#">item 2</a></li>
<li><a href="#">item 3</a></li>
</ul>
</li>
</ul>
</pre>
</div>
</div> <!-- .document-cell #Dropdowns-->
<div class="document-cell">
<h3 id="Tabs" class="typo-h3"># Tabs(标签切换)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<pre class="prettyprint">
// javascript 方式触发
$('#myTab').tab('show')
</pre>
<p><strong>演示:</strong></p>
<!-- demo start -->
<div class="tab">
<ul class="tab-title clearfix">
<li class="tab-title-item"><a href="#" data-toggle="tab">全部</a></li>
<li class="tab-title-item active"><a href="#" data-toggle="tab">个人</a></li>
<li class="tab-title-item tab-title-item-last"><a href="#" data-toggle="tab">商家</a></li>
</ul>
</div> <!-- .tab -->
<!-- demo end -->
<h4 class="typo-h4">二、HTML 标记:</h4>
<p>在触发点添加 <code>data-toggle="tab"</code> 自动触发 Tab,添加 <code>data-target="#对应Tab内容的ID"</code> 或者 <code>href="#对应Tab内容的ID"</code> 来指定对应的 Tab 内容显示。</p>
<pre class="prettyprint">
<ul class="tab-title">
<li class="active"><a href="#home">Home</a></li>
<li><a href="#profile">Profile</a></li>
<li><a href="#messages">Messages</a></li>
<li><a href="#settings">Settings</a></li>
</ul>
<div class="tab-content">
<div class="tab-content-pane active" id="home">...</div>
<div class="tab-content-pane" id="profile">...</div>
<div class="tab-content-pane" id="messages">...</div>
<div class="tab-content-pane" id="settings">...</div>
</div>
</pre>
<p>也可以不使用 <code>data-toggle</code> 来触发,而是使用 javascript 手动触发。</p>
<h4 class="typo-h4">三、支持事件</h4>
<table>
<thead>
<tr>
<th>Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>show</td>
<td>显示一个新的 tab 前触发此事件。可以用 <code>event.target</code> 和 <code>event.relatedTarget</code> 来追踪激活的 tab 和被关闭的 tab (如果有的话) 。</td>
</tr>
<tr>
<td>shown</td>
<td>显示一个新的 tab 后触发引事件。可以用 <code>event.target</code> 和 <code>event.relatedTarget</code> 来追踪激活的 tab 和被关闭的 tab (如果有的话) 。</td>
</tr>
</tbody>
</table>
<pre class="prettyprint">
// 事件示例代码
$('a[data-toggle="tab"]').on('shown', function (e) {
e.target // 被激活的 tab
e.relatedTarget // 上一个激活(已经关闭)的 tab
})
</pre>
</div>
</div> <!-- .document-cell #Tabs-->
<div class="document-cell">
<h3 id="Tips" class="typo-h3"># Tips(浮层提示条)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<pre class="prettyprint">
// javasript 手动触发
$('#tips').popover(options)
</pre>
<p><strong>演示:</strong><button id="tips" data-content="Tips 的内容" title="标题">demo</button></p>
<h4 class="typo-h4">二、Options 对象</h4>
<p>Tips 只有唯一的方法:.popover(Options)。传入的 Options 可以是对象,也可以是字符串。当传入的 Options 是对象时,使用下面的属性:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>animation</td>
<td>boolean</td>
<td>true</td>
<td>应用 CSS 动画</td>
</tr>
<tr>
<td>placement</td>
<td>string|function</td>
<td>'right'</td>
<td>显示的位置,可以是:top | bottom | left | right</td>
</tr>
<tr>
<td>selector</td>
<td>string</td>
<td>false</td>
<td>如果设定选择器,那 Tips 则只在该选择器上生效。</td>
</tr>
<tr>
<td>trigger</td>
<td>string</td>
<td>'hover'</td>
<td>触发 Tips 的事件,可以是:hover | focus | manual</td>
</tr>
<tr>
<td>title</td>
<td>string | function</td>
<td>''</td>
<td>如果没有 <code>title</code> 标签时默认值。</td>
</tr>
<tr>
<td>content</td>
<td>string | function</td>
<td>''</td>
<td>如果没有设置 <code>data-content</code> 时的默认值。</td>
</tr>
<tr>
<td>delay</td>
<td>number | object</td>
<td>0</td>
<td>
<p>显示和隐藏 Tips 的过渡时间,以 ms 为单位</p>
<p>如何只设定一个 {number},则会同时应用到 <code>show/hide</code> 上。</p>
<p>可以以对象方式传值: <code>delay: { show: 500, hide: 100 }</code></p>
</td>
</tr>
</tbody>
</table>
<p>当 Options 是一个字条串的时候,如下使用:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>show</td>
<td>显示 Tips</td>
</tr>
<tr>
<td>hide</td>
<td>隐藏 Tips</td>
</tr>
<tr>
<td>toggle</td>
<td>反复显示/隐藏 Tips</td>
</tr>
</tbody>
</table>
<h4 class="typo-h4">三、HTML 标记:</h4>
<pre class="prettyprint">
<button id="tips" data-content="Tips 的内容" title="标题">demo</button>
</pre>
</div>
</div> <!-- .document-cell #Tips-->
<div class="document-cell">
<h3 class="typo-h3" id="Alert"># Alert(可关闭消息)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<pre class="prettyprint">
// 如果不使用选择器,则直接关掉 <code>.close</code> 用 <code>class="alert"</code> 的标签
$(".alert").alert(Options)
</pre>
<p class="alert fade in">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>演示:</strong>hello world
</p>
<h4 class="typo-h4">二、Options 对象</h4>
<p>Modal 只有唯一的方法:<code>.modal(Options)</code>。传入的 Options 是字符串时,关闭这个 Alert Message。代码如下:</p>
<pre class="prettyprint">$(".alert").alert('close');
</pre>
<h4 class="typo-h4">三、HTML 标记:</h4>
<p>添加关闭按钮:</p>
<pre class="prettyprint"><a class="close" data-dismiss="alert" href="#">×</a>
// 目标:使用 javascript 指定目标,或者直接作为 <code>.close</code> 的父元素,添加 <code>class="alert"</code>
<p class="alert fade in">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>演示:</strong>hello world
</p>
</pre>
<p>如果想让弹出框有动画效果,只需要给目标元素添加 <code>.fade</code> 这个 class,如上代码所示。</p>
<h4 class="typo-h4">四、支持事件</h4>
<table>
<thead>
<tr>
<th>Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>close</td>
<td>在块被关闭的瞬间触发。</td>
</tr>
<tr>
<td>closed</td>
<td>在块关闭,CSS 动画完成后触发。</td>
</tr>
</tbody>
</table>
<pre class="prettyprint">// 事件示例代码
$('#my-alert').bind('closed', function () {
// do something…
})
</pre>
</div>
</div> <!-- #Alert -->
<div class="document-cell">
<h3 id="Typeahead" class="typo-h3"># Typeahead(自动完成)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<pre class="prettyprint">$('.typeahead').typeahead();
</pre>
<p><strong>演示:</strong> <input data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'></p>
<!-- demo end -->
<h4 class="typo-h4">二、Options 对象</h4>
<p>Typeahead 只有唯一的方法:<code>.typeahead(Options)</code>。传入的 Options 对象有以下属性/方法:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>source</td>
<td>array</td>
<td>[ ]</td>
<td>自动完成的数据。</td>
</tr>
<tr>
<td>items</td>
<td>number</td>
<td>8</td>
<td>自动完成显示的最大数目。</td>
</tr>
<tr>
<td>matcher</td>
<td>function</td>
<td>case insensitive</td>
<td>匹配自动完成项。接受唯一的参数 <code>item</code> 以匹配当前完成的内容。可以使用 <code>this.query</code> 来得到当前自动完成的项。如果匹配到相应的选择,则返回一个布尔值:<code>true</code>。</td>
</tr>
<tr>
<td>sorter</td>
<td>function</td>
<td>exact match,<br> case sensitive,<br> case insensitive</td>
<td>用以排序自动完成项的方法。接受一个参数 <code>items</code>,可以使用 <code>this.query</code> 来得到当前自动完成的项。</td>
</tr>
<tr>
<td>highlighter</td>
<td>function</td>
<td>highlights all default matches</td>
<td>用以高亮匹配项的方法。接受一个参数 <code>item</code>。必须返回 html。</td>
</tr>
</tbody>
</table>
<h4 class="typo-h4">三、HTML 标记:</h4>
<p>添加 <code>data-provide="typeahead"</code> 来获得自动完成。可以使用 <code>data-source="数组"</code> 来提供自动完成的项。也可以在 Options 中提供。</p>
<pre class="prettyprint">
<input type="text" data-provide="typeahead" />
</pre>
</div>
</div> <!-- .document-cell #Typeahead-->
<div class="document-cell">
<h3 id="Collapse" class="typo-h3"># Collapse(折叠)</h3>
<div class="document-cell-box typo">
<h4 class="typo-h4">一、如何使用:</h4>
<pre class="prettyprint">$(".collapse").collapse();
</pre>
<p><strong>演示:</strong></p>
<div id="accordion2">
<div class="accordion">
<div class="accordion-heading">
<a href="#collapseOne" data-parent="#accordion2" data-toggle="collapse" class="collapse-toggle">
Collapsible Group Item #1
</a>
</div>
<div class="accordion-body collapse in" id="collapseOne">
<p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
<div class="accordion">
<div class="accordion-heading">
<a href="#collapseTwo" data-parent="#accordion2" data-toggle="collapse" class="collapse-toggle">
Collapsible Group Item #2
</a>
</div>
<div class="accordion-body collapse" id="collapseTwo">
<p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
<div class="accordion">
<div class="accordion-heading">
<a href="#collapseThree" data-parent="#accordion2" data-toggle="collapse" class="collapse-toggle">
Collapsible Group Item #3
</a>
</div>
<div class="accordion-body collapse" id="collapseThree">
<p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<!-- demo end -->
<h4 class="typo-h4">二、Options 对象</h4>
<p>Typeahead 只有唯一的方法:<code>.typeahead(Options)</code>。传入的 Options 对象有以下属性/方法:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>type</th>
<th>default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>parent</td>
<td>selector</td>
<td>false</td>
<td>对于指定同一个父节点的多个折叠标签,当其中一个显示,则其他的都会关闭。</td>
</tr>
<tr>
<td>toggle</td>
<td>boolean</td>
<td>true</td>
<td>交替显示/隐藏</td>
</tr>
</tbody>
</table>
<h4 class="typo-h4">三、HTML 标记:</h4>
<p>在触发点上添加 <code>data-toggle="collapse"</code> 和 <code>data-target</code> 将会自动添加折叠控制。<code>data-target</code> 接受一个 CSS selector(jQuery),指向要折叠的内容,记得在所指向的标签添加 <code>class="collapse"</code>。如果想让折叠的内容默认打开,可以添加额外的 class <code>in</code>。可以通过设置 <code>data-parent="#selector"</code> 来指定所属组,详见 Options 中的 <code>parent</code></p>
<pre class="prettyprint">
<button class="btn btn-danger" data-toggle="collapse" data-target="#demo">
simple collapsible
</button>
<div id="demo" class="collapse in"> … </div>
</pre>
<h4 class="typo-h4">四、方法:<code>.collapse(options)</code></h4>
<p>可以用于激活一个可折叠元素。接受传入一个 Object:</p>
<pre class="prettyprint">
$('#myCollapsible').collapse({
toggle: false
})
</pre>
<strong>Note: Options 也可以是一个字符串</strong>
<table>
<thead>
<tr>
<td>参数</td>
<td>描述</td>
</tr>
</thead>
<tbody>
<tr>
<td>toggle</td>
<td>交替显示/隐藏一个元素</td>
</tr>
<tr>
<td>show</td>
<td>显示一个折叠元素</td>
</tr>
<tr>
<td>hide</td>
<td>隐藏一个折叠元素</td>
</tr>
</tbody>
</table>
<h4 class="typo-h4">四、支持事件:</h4>
<pre class="prettyprint">
$('#myCollapsible').on('hidden', function () {
// do something…
})
</pre>
<table>
<thead>
<tr>
<th style="width: 150px;">Event</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>show</td>
<td>折叠被打开的时候同时触发 <code>show</code> 事件</td>
</tr>
<tr>
<td>shown</td>
<td>折叠已经完全打开,触发此事件</td>
</tr>
<tr>
<td>hide</td>
<td>
折腾被关闭时触发此事件
</td>
</tr>
<tr>
<td>hidden</td>
<td>折腾已经完全关闭,触发此事件</td>
</tr>
</tbody>
</table>
</div>
</div> <!-- .document-cell #Collapse-->
</div> <!-- #document -->
<div id="footer" class="grid grid-20">
<small>版权所有: 客齐集网络信息技术服务(上海)有限公司</small>
</div>
</div> <!-- .container -->
<div class="modal fade hide" id="myModal">
<h4 class="modal-title">本操作需要您先注册百姓网</h4>
<a class="close" data-dismiss="modal" href="###">×</a>
<div class="modal-content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div> <!-- .modal -->
<script type="text/javascript" src="./javascripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="./javascripts/plugins.js"></script>
<script type="text/javascript" src="instant.js"></script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。