JQuery not sliding folder
I am trying to get a iPhone looking folder menu bar. When i click each item (info tab_(number), it should open the appropriate "infotab_(number)_s" div. _s standing for "show". When one is open and the user click another item on the menu bar, it should close and open the one they clicked. My script doesn't open them, maybe I wrote something wrong.
Here is my fiddle: http://jsfiddle.net/7FkqH/
So basically if I click the first li with id of infotab_one, It should slide down, info tab_one_s. 开发者_JAVA百科If I click info tab_two, it should close infotab_one_s and open infotab_two_s.
If that doesn't make sense I will clarify if needed.
Here's a fiddle, i think this is what you intended.
$('.infotab:visible').slideUp('fast');
In the code above you had sideDown and a callback function. The first time you click on a #nav_login_navigation li
there's no visible .infotab
's hence $('.infotab:visible').slideDown('fast', function() {
will not run because no visible divs with class .infotab
were found. Since you want previous visible divs to disappear you want slideUp
instead and not slideDown
.
精彩评论