29 Star 83 Fork 46

缪斯的情人 / Puerh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
javascript.html 31.08 KB
一键复制 编辑 原始数据 按行查看 历史
缪斯的情人 提交于 2013-06-03 17:32 . init commit
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JavaScript Plugins &gt; 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">
&lt;button data-toggle="modal" data-target="#myModal"&gt;demo&lt;/button&gt;
// 目标
&lt;div class="fade hide" id="myModal"&gt;
&lt;a data-dismiss="modal" class="close"&gt;×&lt;/a&gt;
hello world
&lt;/div&gt;
</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">
&lt;ul&gt;
&lt;li id="#myDropdown"&gt;&lt;button data-toggle="dropdown" data-target="#myDropdown"&gt;dropdown&lt;/button&gt;
&lt;ul class="dropdown-menu"&gt;
&lt;li&gt;&lt;a href="#"&gt;item 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;item 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;item 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</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">
&lt;ul class="tab-title"&gt;
&lt;li class="active"&gt;&lt;a href="#home"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#profile"&gt;Profile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#messages"&gt;Messages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#settings"&gt;Settings&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="tab-content"&gt;
&lt;div class="tab-content-pane active" id="home"&gt;...&lt;/div&gt;
&lt;div class="tab-content-pane" id="profile"&gt;...&lt;/div&gt;
&lt;div class="tab-content-pane" id="messages"&gt;...&lt;/div&gt;
&lt;div class="tab-content-pane" id="settings"&gt;...&lt;/div&gt;
&lt;/div&gt;
</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">
&lt;button id="tips" data-content="Tips 的内容" title="标题"&gt;demo&lt;/button&gt;
</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="#">&times;</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">&lt;a class="close" data-dismiss="alert" href="#"&gt;&times;&lt;/a&gt;
// 目标:使用 javascript 指定目标,或者直接作为 <code>.close</code> 的父元素,添加 <code>class="alert"</code>
&lt;p class="alert fade in"&gt;
&lt;a class="close" data-dismiss="alert" href="#"&gt;&times;&lt;/a&gt;
&lt;strong&gt;演示:&lt;/strong&gt;hello world
&lt;/p&gt;
</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">
&lt;input type="text" data-provide="typeahead" /&gt;
</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">
&lt;button class="btn btn-danger" data-toggle="collapse" data-target="#demo"&gt;
simple collapsible
&lt;/button&gt;
&lt;div id="demo" class="collapse in"&gt;&lt;/div&gt;
</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="###">&times;</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>
CSS
1
https://gitee.com/muse/puerh.git
git@gitee.com:muse/puerh.git
muse
puerh
Puerh
master

搜索帮助