jquery - add callback function to custom function -


i have html code

<div class="weather"> <div id="weather"></div> </div> 

i'm using code hide weather display in fadein effect fadein not working how can make weather div display fadein effect?

    $("#weather").weatherfeed(['saxx0017']);     $("select[name='weather']").change(function(){         var city = $(this).val()         //alert(city);         $(".weather").fadeout(500,function(){             $(this).children("#weather").empty();             $("#weather").weatherfeed([city]);             $(".weather").fadein(500);         });      }); 

based on comments: connecting remote hosts typically done via async calls, means #weather empty when call .fadein(), animation not displayed correctly.

make sure .weatherfeed() not async call. if is, should attach .fadein() callback instead. if isn't, try moving .empty() call in it.


Comments