/ Published in: XHTML
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <style type="text/css"> ul#state-menu { width: 240px; background: #ccc; } ul#state-menu li { list-style-type: none; } ul#state-menu ul, ul#state-menu li.first, .js ul#state-menu li.last { display: none; } ul#state-menu li.last, .js ul#state-menu li.first, ul#state-menu li.expand ul { display: block; } </style> <script type="text/javascript"> $(document).ready(function() { $('ul#state-menu li.first').toggle(function() { $(this).addClass('expand'); }, function() { $(this).removeClass('expand'); }); }); </script> </head> <body> <ul id="state-menu"> <ul> </ul> </li> </ul> </body> </html>