You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
676 B

  1. semantic.sidebar = {};
  2. // ready event
  3. semantic.sidebar.ready = function() {
  4. // selector cache
  5. var
  6. // alias
  7. handler
  8. ;
  9. $('.variation .button')
  10. .on('click', function() {
  11. $(this)
  12. .toggleClass('active')
  13. .siblings()
  14. .removeClass('active')
  15. ;
  16. $('.sidebar')
  17. .filter($(this).data('variation') ).first()
  18. .sidebar('toggle')
  19. ;
  20. })
  21. ;
  22. $('.styled.sidebar').first()
  23. .sidebar('attach events', '.styled.example .button')
  24. ;
  25. $('.floating.sidebar').first()
  26. .sidebar('attach events', '.floating.example .button')
  27. ;
  28. };
  29. // attach ready event
  30. $(document)
  31. .ready(semantic.sidebar.ready)
  32. ;