开发者

jQuery fade out variable and element by class

开发者 https://www.devze.com 2023-04-04 18:52 出处:网络
Anyway to include both in a function? I imagined this would work, but it di开发者_Go百科dn\'t var slide = $(\'.z:visible\'),

Anyway to include both in a function? I imagined this would work, but it di开发者_Go百科dn't

var slide = $('.z:visible'),
    next  = slide.next();

$(next, '.h').fadeOut(400);
//as opposed to next.fadeOut(400); $('.h').fadeOut(400);


This is accomplished with the add method:

var slide = $('.z:visible');
slide.next().add('.h').fadeOut(400);
0

精彩评论

暂无评论...
验证码 换一张
取 消