Don't collapse a list on page load
I've made a animated collapsable list using
this script. But now I want to keep one submenu expanded, I have the ID of the ul that must be kept expanded. So after everything is collapsed my script checks the ID of every submenu and compares it to the given ID. If the ID of the submenu is equal to the given ID, the submenu should expand. Should, because that doesn't. Here's the code:
- for(var i = 0; i < $('li:has(ul)').length; i++)
- {
- if ($('li:has(ul)')[i].id == givenid)
- {
- $('li:has(ul)')[i].children().toggle('slow')
- break;
- }
- }
I've never used jQuery before, I tried this, but it doesn't work. Also, I don't want to toggle the children, but just show them; without an animation.
Thanks in advance for your help.