Rob
Rob

Reputation: 39

jQuery fadeOut a variable and normal element not working

I'm trying to fadeout a variable and normal element. Independently they do fadeout but not together. What am I doing wrong?

doesn't work(i've tried the combinations I could find or came to mind):

    var action = $(this).find('.min, .close');
    $('#nav ul,'+action+'').fadeOut("fast");

does work:

    $(this).find('.min, .close').fadeOut("fast");
    $('#nav ul').fadeOut("fast");   

Upvotes: 0

Views: 281

Answers (1)

Litek
Litek

Reputation: 4888

Try:

var action = $(this).find('.min, .close');
action.add('#nav ul').fadeOut("fast");

Upvotes: 3

Related Questions