13

I am trying to use draggabilly available at https://github.com/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.com/draggabilly.pkgd.min.js

Nomi
  • 710
  • 3
  • 11
  • 21
  • Did you look at what `t` is in either the debugger or `console.log(t)`? That seems kind of the obvious first step and then look back at how you populate `t` for ideas on why it isn't set properly. – jfriend00 Feb 20 '14 at 05:58
  • thanks for reply. I got it working. I just copied complete html code for demo in wordpress. – Nomi Feb 20 '14 at 06: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 Jul 29 '14 at 08:06
  • 1
    @Incodeveritas Thanks for commenting - though I'm not using D3, you led me to a solution. – Brendan Jul 28 '15 at 01:05

2 Answers2

2

You are calling init twice. Go through your code and remove one instance.

0

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).

centurian
  • 1,168
  • 13
  • 25