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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -