2012-09-18 177 views
0

我想为我的网站显示/隐藏菜单。显示/隐藏jQuery菜单

我希望它的功能类似于www.nicolaspopupshop.com,当您点击网站底部的"Partners"

我已经试过这一整天,我只是很困惑它如何工作。

我对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; } 

我试图把我在身体标记,但我不能得到正常显示。

+6

你到现在为止的尝试。只需发布一些代码。 –

+0

老兄,忘了CSS。发布你的html和javascript。 – Ringo

回答

0
$(document).ready(function() { 
    var $list = $("#your-ul"); 
    $("#your-toggle-link").bind('click', function() { 
     $list.slideToggle(); 
    }) 
}); 
+0

谢谢,但它仍然不适合我。我在我的问题中添加了我的样式标记中的内容,我认为这不会有太大帮助,但如果您能够查看并提出建议,对我而言意义重大。 – justin

0

首先创建一个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 
    }) 
}); 
+0

非常感谢,但它仍然不适合我。我将我的样式标记中的代码添加到了我的问题中,但不确定这会有所帮助。 – justin