我有以下代码来捕获浏览器调整大小事件。
window.onresize = function(){
var style = $('#button-selection').position();
if(style == "relative"){
$("#button-section").css("position"," ");
}else if(style == "fixed"){
$("#button-section").css("position","relative");
}
};
window.onresize = function(){
var style = $('#button-selection').css('position');
if(style == "relative"){
$("#button-section").css("position"," ");
}else if(style == "fixed"){
$("#button-section").css("position","relative");
}
};
样式返回未定义。当文档准备好时,我正在运行它。我尝试使用窗口就绪,但结果是一样的。上述两种方法都返回未定义!