在ready方法中functioncallbackOpenseadragon(){console.log('1111111111111111111111111111');$('#pathologyID').css('height',$('.navigator').height());$('#pathologyID').css('width',$('.navigator').width());$('#pathologyID').css('top',$('.navigator').height()+50);}functionwindowResizeEvent(callbackOpenseadragon){varfirstFire=null;window.onresize=function(){console.log('aaaa');if(firstFire===null){firstFire=setTimeout(function(){firstFire=null;callbackOpenseadragon;},100);}}}windowResizeEvent();callbackOpenseadragon方法没有被用到,windowResizeEvent执行了,应该怎么改?
2 回答
红糖糍粑
TA贡献1815条经验 获得超6个赞
传参做什么,直接在函数里调用不就好了functionwindowResizeEvent(){varfirstFire=null;window.onresize=function(){console.log('aaaa');if(firstFire===null){firstFire=setTimeout(function(){firstFire=null;callbackOpenseadragon();},100);}}}
小唯快跑啊
TA贡献1863条经验 获得超2个赞
varcallbackOpenseadragon=function(){console.log('1111111111111111111111111111');$('#pathologyID').css('height',$('.navigator').height());$('#pathologyID').css('width',$('.navigator').width());$('#pathologyID').css('top',$('.navigator').height()+50);}functionwindowResizeEvent(callbackOpenseadragon){varfirstFire=null;window.onresize=function(){console.log('aaaa');if(firstFire===null){firstFire=setTimeout(function(){firstFire=null;callbackOpenseadragon();},100);}}}windowResizeEvent(callbackOpenseadragon);
添加回答
举报
0/150
提交
取消