在ready方法中
function callbackOpenseadragon(){
console.log('1111111111111111111111111111');
$('#pathologyID').css('height',$('.navigator').height());
$('#pathologyID').css('width',$('.navigator').width());
$('#pathologyID').css('top',$('.navigator').height()+50);
}
function windowResizeEvent(callbackOpenseadragon) {
var firstFire = null;
window.onresize = function () {
console.log('aaaa');
if(firstFire === null) {
firstFire = setTimeout(function() {
firstFire = null;
callbackOpenseadragon;
}, 100);
}
}
}
windowResizeEvent();
callbackOpenseadragon方法没有被用到,windowResizeEvent执行了,应该怎么改?
解决方案
function windowResizeEvent() {
var firstFire = null;
window.onresize = function () {
console.log('aaaa');
if(firstFire === null) {
firstFire = setTimeout(function() {
firstFire = null;
callbackOpenseadragon();
}, 100);
}
}
}