jQuery jBellows Plugin



Download This Example


This plugin lets you create an extremely lightweight accordion effect.


Demo


CSS for this example

.jBellows {
   padding: 3px 10px 3px 10px;
   width:350px;
   float:left;
}

.jBellows ul {
   padding: 0;
}

.jBellows li {
   background: #FFF;
   list-style-type:none;
   padding:10px;
   line-height:20px;
}

.jb_expand, .jb_expanded {
   color:#FFF;
   background:#000 url('arrows.png') no-repeat center center;
   height:30px;
   width:20px;
   margin-top:-5px;
   cursor:pointer;
   float:right;
}

.jb_expand:hover {
   color:#F00;
   background-color:#F00;
}



HTML for this example

Wrap the whole thing in this: <ul class="jBellows">

For each item with subitems you'd like to add:
<li>Menu Item 4<span class="jb_expand"></span>
   <ul>
      <li>Item 4 Subitem
      <li>Item 4 Subitem
      <li>Item 4 Subitem
      <li>Item 4 Subitem
      <li>Item 4 Subitem
   </ul>
</li>



jQuery for this example

$(document).ready(function(){
   $('.jBellows').jBellows({
      speed: 500,
      easing: 'easeInOutQuint'
   });
});

Notes
Any easing works, but easing is not required. The plugin checks for the easing default variables to see if the easing plugin is present, so added easing to this without having the easing plugin doesn't break it.

Comments (1)

Thanks
Thanks guys - these tips are of great help...
Hope I can return the favour one day
#1 - Brad - 07/27/2010 - 03:58
Name
E-mail (Will not appear online)
Homepage
Title
Comment
To prevent automated Bots form spamming, please enter the text you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
»
This comment form is powered by GentleSource Comment Script. It can be included in PHP or HTML files and allows visitors to leave comments on the website.