Using the following function to hide all elements of a class before showing the right one. But I’m getting a double animation on the later elements.
Function is called by an h2.
Function is:
function showSubList(obj) {
var elem = obj;
$('.sublist').hide(function() {
$(elem).parent().children('.sublist').show();
});
}
Hide the elements first then show the one you want.
This fixes the double animation.
DEMO