Created
July 2, 2009 01:49
-
-
Save Oshuma/139219 to your computer and use it in GitHub Desktop.
Simple ass jQuery accordion effect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Add a class to the link and info elements. --> | |
| <li> | |
| <a class="show-info" href="#">Show The Element</a> | |
| <div class="info" style="display: none;"> | |
| Some content here. | |
| </div> | |
| </li> | |
| <!-- etc. --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| // Attach this to the link elements. | |
| $('.show-info').click(function() { | |
| var info = $(this).siblings('.info'); | |
| $('.info').slideUp('fast'); // Hide the other info divs. | |
| info.slideDown('fast'); | |
| return false; | |
| }); | |
| }); // $(document).ready() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment