How to fix Window.getComputedStyle is not an object error

I am trying to use draggabilly at https://github.com/desandro/draggabilly

it works fine in html. Now that I have tried to add it to wordpress. I get the following error in firebug console.

TypeError: Argument 1 of Window.getComputedStyle is not an object. return s.getComputedStyle(t, null) 

here is the link for the js file http://draggabilly.desandro.com/draggabilly.pkgd.min.js

+12
javascript jquery jquery-ui drag-and-drop
source share
2 answers

I got this error when testing my project with IE8: finally, it was so obvious, this method does not work with IE 8!

 Error: Object doesn't support this property or method at: http://... 

I got this error with FF that supports 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 appears even if your window object is ok, but querySelector nothing! (I suspect this is your case).

0
source share

You call init twice. Go through your code and delete one instance.

0
source share

All Articles