I have a div which is comprised of two smaller divs. When a button is clicked I want the divs to fade out one after another, but then the div to remain in place in case the function to display them is called again.
I had the fadeout work perfectly, but then if the function was recalled nothing would happen.
So I added show commands. This cancelled the fadeout so if you click the button both divs just disappear immediately now and if the function is called again only the first div#MessageTotal displays what it is meant to - I can see no signs of the second div#NewMessageList.
My code is.
Code:
$('#ShowMyMessages').live('click',function(){
$('div#NewMessageList').fadeOut('slow');
$('div#MessageTotal').delay(1500).fadeOut('slow');
$('div#MessageNew').delay(2000).show();
$('div#MessageTotal').delay(2500).show();
$('div#NewMessageList').delay(3000).show();
});
My place holders are:
Code:
<div class="MessageNew" id="MessageNew"><div class="NewMessageList" id="NewMessageList"></div><div class="MessageTotal" id="MessageTotal"></div></div>
My call function is:
Code:
<img src="side/Envelope.jpg" width="40px" onclick="loadMyNewMessages(\'getTotalMessages.php\',\'MessageTotal\',\'getNewMessagesList.php\',\'NewMessageList\')" />';
And message total has the button ShowMyMessages.