Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Syntax error?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30875
    rzea
    Member

    My code hinting is saying there’s a syntax error towards the bottom });


    Any idea what’s going on?

    Thanks in advance,

    #71326
    Bob
    Member

    Your curly bracket on line 2 of your code pasted above doesn’t have a closing curly bracket.
    Add one on the last line of the script, so it will read

    }});

    instead of

    });
    #71262
    rzea
    Member

    Fixed, like this:

    $(function(){
    $('.click-menu h6 span').click(function(){
    if ($(this).hasClass('selected')) {
    $(this).removeClass('selected');
    $(this).parent().next().slideUp('', function() {
    $('.generic-box a, .generic-box p').css('z-index','1');
    });

    } else {
    $('.click-menu h6 span').removeClass('selected');
    $(this).addClass('selected');
    $('.click-menu div').slideUp('fast');
    $(this).parent().next().slideDown('fast');
    $('.generic-box a, .generic-box p').css('z-index','0');
    $('.radio-btns-wrapper-wjs').slideUp('');
    }
    });
    });

    Thanks for your help Bob.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.