Fading multiple elements simultaneously - jquery
You can use the add
method to get the elements in the same jQuery object:
newPanel.add(prevBtn).add(nextBtn).add(infoPanel).fadeIn(200);
Assuming that newPanel
and so on are variables created like that:
newPanel = $("#newPanel");
just write:
newPanel.fadeIn(200);
prevBtn.fadeIn(200);
nextBtn.fadeIn(200);
infoPanel.fadeIn(200);