Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('.toggle').click(function () {
- if ($(this).hasClass("expanded")) {
- $(this).next().slideUp("fast");
- } else {
- $('.toggle').next().slideUp("fast").removeClass("expanded");
- $(this).next().slideDown("fast");
- $(this).removeClass("collapsed");
- $(this).addClass("expanded");
- }
- });
- });
- $(document).ready(function() {
- $('.toggle').click(function () {
- if ($(this).hasClass("expanded")) {
- $(this).next().slideUp("fast");
- $(this).addClass('collapsed');
- $(this).removeClass('expanded');
- } else {
- var $expandedItems = $('.expanded');
- $expandedItems.next().slideUp("fast")
- $expandedItems.addClass('collapsed');
- $expandedItems.removeClass('expanded');
- $(this).next().slideDown("fast");
- $(this).removeClass("collapsed");
- $(this).addClass("expanded");
- }
- });
- });
- $(document).ready(function() {
- $('.toggle').click(function () {
- if ($(this).hasClass("expanded")) {
- $(this).next().slideUp("fast");
- } else {
- $('.expanded').removeClass('expanded');//here is your problem
- $(this).next().slideDown("fast");
- $(this).removeClass("collapsed");
- $(this).addClass("expanded");
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement