simplemenu.js 879 B

1234567891011121314151617181920212223242526272829303132
  1. // $Id$
  2. $(document).ready(function() {
  3. // get the Drupal basepath
  4. var basePath = Drupal.settings.simplemenu.basePath;
  5. // get the element to add the menu to
  6. var element = Drupal.settings.simplemenu.element;
  7. var menu = '<ul id="simplemenu" class="clear-block"></ul>';
  8. switch (Drupal.settings.simplemenu.placement) {
  9. case 'prepend':
  10. $(menu).prependTo(element);
  11. break;
  12. case 'append':
  13. $(menu).appendTo(element);
  14. break;
  15. case 'replace':
  16. $(element).html(menu);
  17. break;
  18. }
  19. $('body').css('margin-top', '23px');
  20. // Drupal menu callback
  21. $('#simplemenu').load(basePath + 'simplemenu/menu', function() {
  22. $('li', this).hover(function() {
  23. $('ul', this).slideDown(200);
  24. }, function() {});
  25. $('a', this).title('');
  26. $(this).children('li.expanded').addClass('root');
  27. });
  28. });