The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "SVG" Oct 14 - 6:30 PM Eastern
Get a free trial // Grow your CSS skills // Land your dream job

Any link clicked collapses accordion [jQuery]

  • # October 19, 2009 at 4:16 pm

    Hey guys,

    I am building an accordion for my blog and everything works fine except for one little thing. Whenever I put a link into one of the boxes, the accordion slides back up instead of following through with the link. The only time I want this accordion to work is when .heading is clicked. Here is the jQuery code:

    $(document).ready(function() {
    $(‘.heading’).click(function() {
    if($(this).parent().hasClass(‘current’)) {
    $(this).siblings(‘ul’).slideUp(‘slow’,function() {
    } else {
    $(‘ul#accordion li.current ul’).slideUp(‘slow’,function() {
    $(this).siblings(‘ul’).slideToggle(‘slow’,function() {
    return false;

    If it matters at all, I followed the [ulr=]]tutorial here at Nettuts[/URL], but they do not account for this issue!

    If it helps at all, here is the HTML to go along with it:

    Really appreciate any help! You guys were quick to help me with my last problem and I can’t tell you enough how much I appreciate it. :D

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed