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

Problem with base option #46

Open
JB1905 opened this issue Jun 16, 2019 · 3 comments
Open

Problem with base option #46

JB1905 opened this issue Jun 16, 2019 · 3 comments
Labels
bug Something isn't working
Projects

Comments

@JB1905
Copy link
Collaborator

JB1905 commented Jun 16, 2019

@JB1905

v2.0.5 (v2.0.4) probably fixes this bug

Btw it probably produces a bug, when base option is set. With 2.0.3 and base works just fine.
image
Problem is here:
image

Originally posted by @TemaSM in #38 (comment)

@JB1905
Copy link
Collaborator Author

JB1905 commented Jun 16, 2019

@TemaSM I moved the conversation to the new issue.
Could you provide additional information about settings, jQuery version, and whether you've attached platform library.

@TemaSM
Copy link

TemaSM commented Jun 28, 2019

@JB1905 sorry for late reply, missed notifications.

jQuery: 3.4.1
universal-tilt.js: 2.0.4-2.0.5
Didn't attached platform as dependency into page before attaching universal-tilt.js, because there was no info about it in README.

$('.features .card').universalTilt({
    settings: {
      base: 'window',
      reverse: true,
      shine: false,
      max: 20,
      perspective: 900,
      speed: 1000,
      exclude: /(iPod|iPhone|iPad).* Safari/,
    },
  });

So, 2.0.6 fixed problem and base option works just fine as it was working in 2.0.3.

But, please pay attention to maybe another issue with base option.
If we set base option value to be window, it produces errors with addEventListener:
image
and if we change value to 'window' (with quotes) it works without any problem.
Should we improve this conditional?:

if (this.settings.base === 'window')

into

if (this.settings.base === 'window' || this.settings.base === window)

I think, that this situation a bit confusing.
Because for example at my first time using universal-tilt.js I was thinking
"Available options" for base means selector for element, but afterwards it became clear - available options ('element', 'window') are just const strings, like enums, not examples of selectors.

@JB1905
Copy link
Collaborator Author

JB1905 commented Jun 28, 2019

Thanks for feedback.
I'm working on version 2.1. The base option will be rebuilt (new values: window, all DOM elements on website). The update will be available next month.
Preview of changes in v2.1

@JB1905 JB1905 added this to In progress in Next Aug 10, 2019
@JB1905 JB1905 added the bug Something isn't working label Jun 19, 2020
@JB1905 JB1905 added this to In progress in 2020 Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
2020
  
In progress
Next
  
In progress
Development

No branches or pull requests

2 participants