A: 

The code as written...

tabContainers.fadeOut('slow', function() {
    second.fadeIn('slow');
});

explicitly calls fadeIn() after fadeOut() is complete. You're passing fadeIn it as a callback to the second parameter to fadeOut, to be executed on completion.

Have you tried this?

tabContainers.fadeOut('slow');
second.fadeIn('slow');
meagar
Yes: I'm trying to get them to act synchronously, i.e. have the fadeIn take place *after* the fadeOut, and it's not working.
Ed Woodcock
A: 

EDIT: Here actually try it like this instead

tabContainers.fadeOut(500);
setTimeout("FadeInImage();", 490);

function FadeInImage()
{
    tabContainers.hide();
    second.fadeIn('slow');
}
jmein
comment retracted, this might work, I'll give it a try.
Ed Woodcock
Ok, this just hides the image instantly: no fading.
Ed Woodcock
yea that was wrong but this new will work I looked back at how we handled things like this before and that was the solution
jmein
A: 

Try queuing the animation instead of running it on callback:

tabContainers.fadeOut('slow').queue(function() {
    second.fadeIn('slow');
    $(this).dequeue();
});
davidosomething
This has exactly the same issue I'm afraid.
Ed Woodcock
+1  A: 

I think the problem is that when you are calling the fadeOut function, some of your items are already faded-out so that it is firing immediately.

The code below is tested and works, but can be refined considerably more. I'll leave that to you:

var tabContainers = $('#tabwrap > div');
var listItems = $('#tabwrap ul.tabnav li');
tabContainers.hide();
var $selectedDiv = $("#tab1").show();

listItems.click(function() {
    var $this = $(this);
    var $myDiv = $("#" + $this.text().toLowerCase());
    if ($selectedDiv.attr("id") != $myDiv.attr("id")) {
        $selectedDiv.fadeOut('slow', function() {
            $myDiv.fadeIn('slow');
        });
        $selectedDiv = $myDiv;
    }

    $('#tabwrap ul.tabnav').removeClass('selected');
    $(this).addClass('selected');

    return false;
});
James Wiseman
a good idea, but that doesn't seem to work either!
Ed Woodcock
Worked out why. Posted edited above
James Wiseman
Legend, nice one!
Ed Woodcock
Never been a legend before. Its a great feeling! ;-)
James Wiseman
haha, that's been a major headache for a while: I've had to mess with your code though, you've assumed that my lovely antiseptic test scenario was like real life and used the <li> content as an identifier: in real life this actually has meaningful information, hence the use of the title attribute. Nothing too problematic though ;)
Ed Woodcock
Its an assumption I made in the code, but not in my head. As you hinted, it wasn't the important bit. Glad to be of help
James Wiseman