jquery element's place when toggeling

Posted by Noam Zadok on Stack Overflow See other posts from Stack Overflow or by Noam Zadok
Published on 2012-09-07T09:31:19Z Indexed on 2012/09/07 9:37 UTC
Read the original article Hit count: 109

Filed under:
|

i'm building a page, which will have categories that will contain a list of pages to go with them. at first all the list are hidden, and than I click on a category and the list slides down. this is the code of the script:

    $(document).ready(function() {
            $('.menu-list').hide();
            $('.menu-title').click(function() {
                if ($(this).next().is(':not(:visible)')) {
                    $('.menu-list:visible').slideUp();
                    $(this).next().slideDown();
                }
     });

The script works, but the problem is when I'm clicking on a category in a column that has more categories than the other. than the last category is moving to the left and I don't want it to. Here is the code in jsfiddle: http://jsfiddle.net/U7rKX/4/

Can you help me?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html