-------------------------------------------------------------------------------------------------------------+ INTRO -------------------------------------------------------------------------------------------------------------+ This shows the basics of expanding menus with e107 It makes use of e107s built in javascript 'expandit' -------------------------------------------------------------------------------------------------------------+ THE VERY BASICS NEEDED TO CREATE AN EXPANDING MENU -------------------------------------------------------------------------------------------------------------+ - Something to click on which is normally always visible:
CLICK HERE
- The content to expand and collapse:
CONTENT
-------------------------------------------------------------------------------------------------------------+ MULTIPLE EXPANDING MENU -------------------------------------------------------------------------------------------------------------+ - First we must have a unique id: global $expand_menu_counter; $expand_menu_counter += 1; - Next we must use that unique id to link where you click to whats going to change:
CLICK HERE
CONTENT
-------------------------------------------------------------------------------------------------------------+ CHANGE THE CURSOR STYLE TO A HAND -------------------------------------------------------------------------------------------------------------+ - You use the CSS attribute 'cursor' and set it to 'pointer', do not use 'hand' as that is IE specific.
CLICK HERE
-------------------------------------------------------------------------------------------------------------+ MAKING ALL MENUS COLLAPSED BY DEFAULT -------------------------------------------------------------------------------------------------------------+ - You use the CSS attribute 'display' and set it to 'none'.
CLICK HERE
-------------------------------------------------------------------------------------------------------------+ MAKING SOME MENUS COLLAPSED BY DEFAULT -------------------------------------------------------------------------------------------------------------+ - This requires identifying one menu from another, in this case by its title. function tablestyle($caption, $text) { $expand_autohide_list = array("Weather", "Online"); if (in_array($caption, $expand_autohide_list)) { $expand_autohide = "display:none"; $caption .= " - Click To Expand"; } else { $expand_autohide = ""; } echo "
$caption
CONTENT
"; } -------------------------------------------------------------------------------------------------------------+ AN EXAMPLE OF ALL THE ABOVE WITHIN AN E107 THEME -------------------------------------------------------------------------------------------------------------+ function tablestyle($caption, $text) { global $expand_menu_counter; $expand_menu_counter += 1; $expand_autohide_list = array("Weather", "Online"); if (in_array($caption, $expand_autohide_list)) { $expand_autohide = "display:none"; $caption .= " - Click To Expand"; } else { $expand_autohide = ""; } echo "
$caption
$text

"; } -------------------------------------------------------------------------------------------------------------+