jQuery:Problem in Chaining the events.
- by Shyju
I have the following javascript function which will load data from a server page to the div
This is working fine with the FadeIn/FadeOut effects
function ShowModels(manuId) {
var div = $("#rightcol");
div.fadeOut('slow',function() {
div.load("../Lib/handlers/ModelLookup.aspx?mode=bymanu&mid="+manuId,
{ symbol: $("#txtSymbol" ).val() },
function() {
$(this).fadeIn();
});
});
}
Now i want to Show a Loading Message till the div loads the contents from the server page
I tried this.But its not working.Can any one help me to debug this ? Thanks in advance
function ShowModels(manuId) {
var div = $("#rightcol");
var strLoadingMsg="<img src='loading.gif'/><h3>Loading...</h3>";
div.fadeOut('slow',function() {
div.load(strLoadingMsg,function(){
div.load("../Lib/handlers/ModelLookup.aspx?mode=bymanu&mid="+manuId,
{ symbol: $("#txtSymbol" ).val() },
function() {
$(this).fadeIn();
});
});
});
}
My ultimate requirement is to FadeOut the current content.Show the Loading message.Show the Data coming from server with a FadeIn effect