サマリー:這篇文章主要為大家詳細(xì)介紹了jquery點(diǎn)擊展示與隱藏更多內(nèi)容的相關(guān)資料.html代碼<div id="tips" class="center-block">
這篇文章主要為大家詳細(xì)介紹了jquery點(diǎn)擊展示與隱藏更多內(nèi)容的相關(guān)資料.
html代碼
<div id="tips" class="center-block"> <h5 class="tips_head"> <u>遇到問(wèn)題?</u> </h5> <div class="tips_content"> <ol> <li>Ctrl+F5刷新本頁(yè)面</li> <li>關(guān)閉頁(yè)面,重新加載本頁(yè)面和登錄</li> <li>更換瀏覽器(建議使用火狐和谷歌瀏覽器)</li> <li>聯(lián)系我們 </li> </ol> </div> </div>
jquery代碼
$(function() { //遇到問(wèn)題的彈出文字 $("#tips h5.tips_head").bind("click", function() { var $tips_content = $(this).next("div.tips_content"); if ($tips_content.is(":visible")) { $tips_content.hide(); } else { $tips_content.show(); } }) })
css代碼
.tips_head { padding-left:20px; cursor: pointer ; text-align:left; margin-top:20px; color:red;} .tips_content { padding: ; border-top: 1px solid #0050D0; display:block; display:none; text-indent: 2em; text-align:left; }
更多關(guān)于jquery點(diǎn)擊展示與隱藏更多內(nèi)容請(qǐng)關(guān)注PHP中文網(wǎng)(ipnx.cn)其它文章!