Jon*_*sen 2 html javascript jquery invalid-argument
这让我困惑了好几个小时了.为什么在IE8中测试时会出现"无效参数"错误?
function resizeContainer() {
wHeight = window.innerHeight;
$('.container').each(function () {
$(this).animate({
height: wHeight
}, 400);
});
$('.content').each(function () {
wHeight = window.innerHeight;
fullPad = wHeight - $(this).height();
if (wHeight < 750) {
cropFactor = 1.7;
}
else {
cropFactor = 2;
}
$(this).animate({
paddingTop: fullPad / cropFactor
});
});
}
Run Code Online (Sandbox Code Playgroud)
我得到的确切错误是:
无效的论点.jquery.js,第8826行5
window.innerHeight没有定义现有IE,那么wHeight就是undefined,和fullPad变NaN.试试吧$(window).height() .
在IE中设置无效样式值是"无效参数"错误的原因之一.
| 归档时间: |
|
| 查看次数: |
2800 次 |
| 最近记录: |