admin管理员组文章数量:1287181
I am trying to use draggabilly available at
it works fine in html. Now when i have tried to add it in wordpress. I am getting following error in firebug console.
TypeError: Argument 1 of Window.getComputedStyle is not an object.
return s.getComputedStyle(t, null)
here is a link for js file .pkgd.min.js
I am trying to use draggabilly available at https://github./desandro/draggabilly
it works fine in html. Now when i have tried to add it in wordpress. I am getting following error in firebug console.
TypeError: Argument 1 of Window.getComputedStyle is not an object.
return s.getComputedStyle(t, null)
here is a link for js file http://draggabilly.desandro./draggabilly.pkgd.min.js
Share Improve this question asked Feb 20, 2014 at 5:48 NomiNomi 7603 gold badges11 silver badges22 bronze badges 4-
Did you look at what
t
is in either the debugger orconsole.log(t)
? That seems kind of the obvious first step and then look back at how you populatet
for ideas on why it isn't set properly. – jfriend00 Commented Feb 20, 2014 at 5:58 - thanks for reply. I got it working. I just copied plete html code for demo in wordpress. – Nomi Commented Feb 20, 2014 at 6:42
- 4 In d3.js, you will get this error if you try to make a selection on a non-existent dom object. – Union find Commented Jul 29, 2014 at 8:06
- 1 @Incodeveritas Thanks for menting - though I'm not using D3, you led me to a solution. – Brendan Commented Jul 28, 2015 at 1:05
2 Answers
Reset to default 2You are calling init twice. Go through your code and remove one instance.
I received this error testing my project with IE8: finally it was so obvious, this method doen't work with IE 8!
Error: Object doesn't support this property or method at: http://...
I received this error with FF that does support this method but I forgot to change window
to my frame window object!
console.log(getComputedStyle(window.document.querySelector('.tip > .tip.top'), ':after').getPropertyValue('left'));
TypeError: Argument 1 of Window.getComputedStyle is not an object.
at: http://...
Note that the above error pops up even if your window
object is ok but the querySelector
returns nothing! (I suspect it's your case).
本文标签: javascriptHow to fix WindowgetComputedStyle is not an object errorStack Overflow
版权声明:本文标题:javascript - How to fix Window.getComputedStyle is not an object error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741299007a2370982.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论