回调函数 用法实例

实例来自于友拓网的登录之后的hello页面  气球的页面

setInterval(function(){
$('.bubble-box-item').eq(0).fadeOut(1000,function(){
var infoChangeNode = $(this);
itemPeopleInfoRender(people_infos,infoChangeNode);

//之前一直纠结如果直接回调一个函数名,而这个函数是需要传入参数的那怎么办,办法就是这样   
}).fadeIn(1000);
},time_random[0]);

a.fadeOut(2000,funcName);//这个funName不需要传入参数,如果需要传入参数,那么像下面那样写

a.fadeOut(2000,function(){

  funcName(arg);

});

原文地址:https://www.cnblogs.com/mabelstyle/p/2920513.html