tilt.js
tilt.js copied to clipboard
Hovers over Iframes are broken
When I hover over Iframe trying to use this plugin there is an error:
Uncaught TypeError: Cannot read property 'x' of undefined
at HTMLDivElement.getValues (tilt.jquery.js:91)
at HTMLDivElement.updateTransforms (tilt.jquery.js:106)
getValues @ tilt.jquery.js:91
updateTransforms @ tilt.jquery.js:106
It works perfectly with everything else, but not with one thing I need. I wanted to apply this effect to google maps iframe.
I guess this is kind of issue so here I am :)
Hey, thanks for reporting. Can you provide a codepen example so i can see the issue?
@gijsroge Here is an example: https://jsfiddle.net/orpavLep/ If you hover over iframe it doesn't work, but it works on everything else.
I don't think it's just iframes, I also get it but i'm not sure on what currently
the error appears to be in https://github.com/gijsroge/tilt.js/blob/a92d1bda917e1ba0d0981a6d5cf539917e3cc13b/src/tilt.jquery.js#L119
thanks J
@gijsroge
I temporarily added this line to the top of getValues
if(!this.mousePositions) this.mousePositions = getMousePositions.call(this);
that theoretically would get rid of the error cannot read property 'x' of undefined
however it suggests something is getting called in the wrong order or not being instantiated in time
thanks j
Thank you so much you saved my life!!!