[英]Show/Hide jQuery menu
我想為我的網站顯示/隱藏菜單。
當您單擊網站底部的"Partners"
時,我希望它的功能類似於www.nicolaspopupshop.com上的功能。
我整天都在嘗試這樣做,但是我對它的工作方式感到困惑。
我對HTML相當滿意,但是一旦javascript開始發揮作用,我就一無所知。 我想這對專家來說是一個煩人的問題,但是如果有人可以幫助我,這對我來說將意味着一個世界。
謝謝!
這是樣式標簽中的內容:
#footer .bottom #partners_trigger {
cursor: pointer;
margin-left: 170px; }
#footer .bottom #partner_list {
width: 320px;}
#footer .bottom #partner_list ul {
position: fixed;
text-align:center;
font-size:11px;
text-transform: uppercase;
bottom: 40px;
left: 50%;
width: 320px;
margin: 0 0 0 -160px;
background: #FA9313;
background: rgba(250, 147, 19, 0.85);
padding: 10px 0;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
z-index: 300;
line-height: 18px;
display: none; }
#footer .bottom #partner_list ul a {
color: white;
font-family: Arial, Helvetica;}
#footer .bottom #partner_list ul a:hover {
color: #e9118c; }
#footer .bottom #partner_list ul.active {
display: block; }
我試圖將我的物品放入body標簽,但無法正確顯示。
$(document).ready(function() {
var $list = $("#your-ul");
$("#your-toggle-link").bind('click', function() {
$list.slideToggle();
})
});
首先創建一個div並將其樣式設置為display:none。 我假設您的合作伙伴鏈接的ID為合作伙伴,然后在下面編寫代碼
$(document).ready(function() {
$("#Partners").bind('click', function() {
$("#your_div").slideToggle(); //your_div is the id of the div with display none
})
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.