Find the last list item dynamically
Posted: Wed Nov 07, 2007 2:19 pm
I need to add styling to a menu. The menu when viewed as source looks something like this:
menu 1
menu 2
submenu 1
submenu 2
menu 3
I need to be able to find the last submenu item for any menu and also find the last menu item so I can add a class/id to it to change the styling like this:
menu 1
menu 2
submenu 1
submenu 2
menu 3
Here are my styles as they currently exist.
#gutter_left ul li {
background-color: #00853f;
border-bottom:1px solid #FFFFFF;
}
#gutter_left ul li ul li {
background-color: #00853f;
border-bottom:1px dashed #FFFFFF;
}
#gutter_left .no_border {
border-bottom: 0;
}
I need to be able to find the number of list items, dynamically, and apply this if at all possible.
I am not sure what mod/com writes the menus. Any help would be helpful.
Thanks,
Dan
menu 1
menu 2
submenu 1
submenu 2
menu 3
I need to be able to find the last submenu item for any menu and also find the last menu item so I can add a class/id to it to change the styling like this:
menu 1
menu 2
submenu 1
submenu 2
menu 3
Here are my styles as they currently exist.
#gutter_left ul li {
background-color: #00853f;
border-bottom:1px solid #FFFFFF;
}
#gutter_left ul li ul li {
background-color: #00853f;
border-bottom:1px dashed #FFFFFF;
}
#gutter_left .no_border {
border-bottom: 0;
}
I need to be able to find the number of list items, dynamically, and apply this if at all possible.
I am not sure what mod/com writes the menus. Any help would be helpful.
Thanks,
Dan