Skip to Navigation or Skip to Content

Steve Fenton
Author of The Reason Your Website Sucks

Jquery Side Content

You Are Here: Home » JavaScript » Side Content

Jquery Side ContentQuick Links

Visit the jQuery Side Content project hub, which has a demonstration and download for this plugin on JS Plugins JavaScript Plugin Library.

Description

The jQuery Side Content project is a plugin for the jQuery JavaScript Framework, which converts divisions on the page into tabbed bars glued to the side of the browser window, which expand and contract when the user clicks on the tab header.

Requirements

CSS

  1. /* Optional styles */
  2.  
  3. .sidecontentpullout {
  4. background-color: Black;
  5. color: White;
  6. padding: 4px 3px;
  7. -moz-border-radius-bottomleft: 1em;
  8. -moz-border-radius-topleft: 1em;
  9. -webkit-border-bottom-left-radius: 1em;
  10. -webkit-border-top-left-radius: 1em;
  11. border-bottom-left-radius: 1em;
  12. border-top-left-radius: 1em;
  13. }
  14.  
  15. .sidecontentpullout:hover {
  16. background-color: #444444;
  17. color: White;
  18. }
  19.  
  20. .sidecontent {
  21. background-color: Black;
  22. color: White;
  23. -moz-border-radius-bottomleft: 1em;
  24. -webkit-border-bottom-left-radius: 1em;
  25. border-bottom-left-radius: 1em;
  26. }
  27.  
  28. .sidecontent > div > div {
  29. padding-left: 10px;
  30. padding-right: 40px;
  31. }

JavaScript

  1. $(".side").sidecontent();

With all options set:

  1. $(".side").sidecontent({
  2. classmodifier: "sidecontent",
  3. attachto: "rightside",
  4. width: "300px",
  5. opacity: "0.8",
  6. pulloutpadding: "5",
  7. textdirection: "vertical"
  8. });