Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE Polyfill required #49

Closed
josias-r opened this issue Mar 26, 2019 · 5 comments
Closed

IE Polyfill required #49

josias-r opened this issue Mar 26, 2019 · 5 comments

Comments

@josias-r
Copy link

josias-r commented Mar 26, 2019

Since this library uses the CustomEvent API it will throw an error on IE.
The following Polyfill works fine and should be included in the babel version:

https://polyfill.io/v3/polyfill.min.js?features=CustomEvent

@micku7zu
Copy link
Owner

It looks that the polyfill link provided doesn't work 😢, but I will include the polyfill from https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent. Thanks!

@josias-r
Copy link
Author

I'm using the mentioned polyfill from Polyfill.io in a browser and it works fine🤔, but I think the polyfill code won't show if the UA is unknown / supported.
The MDN polyfill should work just fine as well, thanks for working on this awesome library!

@josias-r josias-r reopened this Mar 29, 2019
@micku7zu
Copy link
Owner

I wanted to implement this, but found out that this Polyfill is not included in Babel: zloirock/core-js#354 (comment).

I will add a message on README. Thanks!

@micku7zu
Copy link
Owner

For anyone having this problem, please include the CustomEvent polyfill for Internet Explorer, before the vanilla-tilt.js:

(function () {

  if ( typeof window.CustomEvent === "function" ) return false;

  function CustomEvent ( event, params ) {
    params = params || { bubbles: false, cancelable: false, detail: null };
    var evt = document.createEvent( 'CustomEvent' );
    evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
    return evt;
   }

  CustomEvent.prototype = window.Event.prototype;

  window.CustomEvent = CustomEvent;
})();

Polyfill urls:

@Imprasna
Copy link

(index):56 Uncaught ReferenceError: VanillaTilt is not defined
I am getting this error can someone help me get this fixed, when using cdn I get this error in my console and it doesn't work the tilt functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants