Accordion Vertical Menu Won't Auto Collapse, Fix It

  • Status: Closed
  • Prize: $10
  • Entries Received: 7
  • Winner: pixelke

Contest Brief

I have a accordion CSS jquery Vertical Menu.
When I click on 1st item, it expands as expected.
but when I click on 2nd item, the 1st item remains expanded, it won't auto collapse.

When user clicks on specific Menu Item, other expanded Menu Item should auto collapse.
Can you help me to fix the problem? Thanks.

I have uploaded my project. You may modify my code directly.

Recommended Skills

Employer Feedback

“He isn\'t the first winner, but he is willing to share his solution which better than 1st winner. I\'ve decided to award 2nd prize winner for him as appreciation. He is expert, helpful and friendly.”

Profile image jdrael, Malaysia.

Public Clarification Board

  • pixelke
    pixelke
    • 11 years ago

    Actually what you're looking for is
    ul.parents('li').siblings().find('ul').animate({ "height": 0 });
    As it doesn't hardcode any classes which makes it more portable, plus it uses a function to search for siblings of the active menu and hides only those, rather then hiding everything. The return false part should also be fixed, there is a lot more sophisticated way to prevent the default action of firing.

    • 11 years ago
    1. jdrael
      Contest Holder
      • 11 years ago

      Hi, pixelke, I have invited you to a project. You are welcome to join at: https://www.freelancer.com/contest/Design-a-Banner-for-a-Website-127692.html

      • 11 years ago
  • jdkamlesh
    jdkamlesh
    • 11 years ago

    hey issue solved.. get it in $2

    • 11 years ago
  • pixelke
    pixelke
    • 11 years ago

    Hello there, I'm done however I can only upload image files here as this is a contest, I'm gonna upload a preview so you can contact me privately and I can send you over the fixed code.

    • 11 years ago
    1. pixelke
      pixelke
      • 11 years ago

      Thank you very much, I would also like to discuss with you how you will use the menu in the future as you might want to update the a click part to prevent some issues. Will start handover now, so we can discuss it there further.

      • 11 years ago
    2. jdkamlesh
      jdkamlesh
      • 11 years ago

      Hey, ur problem for accordian has been solved u can contact me to see all code

      • 11 years ago
  • riadutt1990
    riadutt1990
    • 11 years ago

    waiting for your reply

    • 11 years ago
  • vishpatil4job
    vishpatil4job
    • 11 years ago

    done... 10$s...

    • 11 years ago

Show more comments

How to get started with contests

  • Post your contest

    Post Your Contest Quick and easy

  • Get tons of entries

    Get Tons of Entries From around the world

  • Award the best entry

    Award the best entry Download the files - Easy!

Post a Contest Now or Join us Today!