Reputation: 39
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
Reputation: 4888
Try:
var action = $(this).find('.min, .close'); action.add('#nav ul').fadeOut("fast");
Upvotes: 3