Search code examples
removeclass

Exclude a link from an addClass script.... NEED HELP :-)


I need to EXCLUDE a link from the selected class in this script. Can anyone show me how to exclude a link with a .logo class? Checkout the links and the logo for the home link: link text

$(document).ready(function() {


$('a.panel').click(function () {

    $('a.panel').removeClass('selected');
    $(this).addClass('selected');

    current = $(this);

    $('#wrapperQ').scrollTo($(this).attr('href'), 800);     

    return false;
});

$(window).resize(function () {
    resizePanel();
});

});

Solution

  • try to use not function.

    $('a.panel').not('.logo').click(function () {
      ...
    });