javascript - Window.getComputedStyle does not implement interface Element 错误在 Firefox 中

标签 javascript jquery html css

我想将一些数据附加到 HTML 元素,所以我使用了以下代码:

$("#bookListDiv").append(data.HTMLString);

一切正常,但我想在显示此元素时添加淡入淡出动画,因此我将其修改为:

$(data.HTMLString).hide().appendTo("#bookListDiv").fadeIn(1000);

动画在 Chrome 上运行,但在 Firefox 上我在控制台中看到以下错误: 类型错误:Window.getComputedStyle 的参数 1 未实现接口(interface)元素。 我正在使用 jquery 1.8.2。

你能告诉我哪里可能出错吗?我假设有数据,但在第一种方法中一切正常。

最佳答案

如果您调用 getComputedStyle,您也会得到这个在 <html> .这应该是常识,但我有一个递归函数,它使用这个函数从内部元素冒泡,并在它最终到达文档根目录时给出错误。

关于javascript - Window.getComputedStyle does not implement interface Element 错误在 Firefox 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22849138/

相关文章:

javascript - (jQuery mobile) 动态网格显示很差

javascript - 用于显示 float 选择列表的 Jquery 插件/小部件?

javascript - 如何通过javascript将一些数据保存到数据库后强制单击 "Refresh"链接按钮?

JavaScript 委托(delegate)并选择 AJAX 响应

javascript - 带有两个 st 的事件提交按钮

php - 使用 jQuery $.ajax 检索数据

javascript - HTML5 和分贝计

javascript - vb .net,涉及严格模式的javascript问题

jquery - Highchart - 线条或区域不从左侧点开始

javascript - 当有冒号前缀时比较数字