Fading multiple elements simultaneously - jquery
问题 I want to do the following: $(newPanel, prevBtn, nextBtn, infoPanel).fadeIn(200, function() { } these vars are divs created with jquery but only the first element fades in, I really need all elements to fade in at the same time. 回答1: You can use the add method to get the elements in the same jQuery object: newPanel.add(prevBtn).add(nextBtn).add(infoPanel).fadeIn(200); 回答2: Assuming that newPanel and so on are variables created like that: newPanel = $("#newPanel"); just write: newPanel.fadeIn