Collapsable menus - jquery

noadol / 2010-06-28 18:00:38   


My friend wrote me code for collapsible menu, when pressing one section closes another.

The problem is, when I choose a project from the section's list of projects, the section automatically closes, instead of stay open and let me go through the list.

Hope you can help me.
This is the code, and it's located inside index.php


$(function() {
$("#menu ul:not('.copyrights') li:not('.section-title'):visible").hide(0);

$("#menu ul li.section-title").click(function(){
var menu=$(this).parent();
if (menu.find("li:animated").length>0) return;
if (".copyrights")) return;
if (menu.find("li:gt(0):visible").length>0)

ivo_valadares / 2010-06-28 19:48:42   

I think you can find something more simple.

I use this one and it works more or less that way.

// First we hide all exhibitis
$("#menu ul li.section-title").nextAll().hide();

// then the active exhibit is showed
$("#menu ul").each(function(){

// This is the toggle function
// first it hides all sections
$("#menu ul li.section-title").click(function() //com o rato a pasar por cima e .click seleccionando
$("#menu ul li.section-title").nextAll().hide()


ivo_valadares / 2010-06-28 19:49:32   

Open and free

noadol / 2010-06-29 07:24:18   

Thanks for your help
but the collapsible menu didn't work
Maybe more instructions about where should I locate your code?

Thanks again

ivo_valadares / 2010-06-29 12:00:40   

How come is not working? I see it working very well.

If you want something else... Can't help cause it's all I have.

lemathieu A / 2010-06-29 13:31:24   

yes, it works. Not very fluid, but it works.

noadol / 2010-06-29 17:17:43   

maybe it's not located in the right place.
It's now in the index.php file

Vaska A / 2010-06-29 17:26:17   

It's in the right location...I think it's probably just not written very well. Why not simply use the expanding script that thousands of other people around here have used? It's posted above...

noadol / 2010-06-29 18:54:12   

Thank you all for trying to help )

noadol / 2010-06-29 18:59:00   

Thank you all for trying to help )

This thread has been closed, thank you.