Giter Site home page Giter Site logo

Comments (12)

micku7zu avatar micku7zu commented on June 9, 2024

It doesn't matter where you add it, it should work everywhere.

It depends how your elements are created in the page. If the elements are not present when the VanillaTilt.init function runs, then it won't initiated the script on those elements.

It is not enough to have the script at the end of the body, if the elements are not inside the body when the script is run.

Debugging through screenshots is not enough. Leave a URL and I might be able to help you.

from vanilla-tilt.js.

renanmalato avatar renanmalato commented on June 9, 2024

Hey Mick, Thank you so much for your response. Happy New Year

Here is my test page
https://renan-stnl-uxdesign.com

There is a black box over a section, this container should be on Vanilla - at least on my last website not on wix I was able to do that

I appreciate any kind of advice you might have to me

from vanilla-tilt.js.

micku7zu avatar micku7zu commented on June 9, 2024

Ok, at a quick look on this page, there are multiple issues:

  1. The vanilla-tilt.js file is not loading correctly. The link you use it is not working as you expect, and it loads as 0bytes. So the library is not loaded. Change the github URL to some CDN. I don't know WIX, I never used WIX, so I don't know what methods you have to load a JS file, but the way you use it right now, it doesn't work.
    Screenshot
  2. The JS code is at the beginning of , so if VanillaTilt.init executes at the beginning of when the elements are not on the page, it will not find any elements on the page and it will not apply the effect. You have to include this script at the end of the page, or to run it somehow AFTER the elements are on the page.
  3. .cardglass, .creditcardglass - your element on the page doesn't have this classes. They are prefixed with wixui-
    Screenshot

If you fix this issues, the effect will work: Working effect (this was done in developer console, so it is not actually helping you fix the issues above)

from vanilla-tilt.js.

renanmalato avatar renanmalato commented on June 9, 2024

Hi, I fixed the file KBs linking the script to a CDN as you can see in the Network console

and I also inserted the extended class call to the JS wixui-creditcardglass

if you have a moment to look the link one more time to see if I missed something I appreciate it, thank you

Screen Shot 2024-01-01 at 11 45 36 AM Screen Shot 2024-01-01 at 11 44 24 AM

from vanilla-tilt.js.

micku7zu avatar micku7zu commented on June 9, 2024

The <script> is still loaded at the start of the page, before the elements are inserted on the page. You have to include it at the end.

Or you can try this code:

document.addEventListener("DOMContentLoaded", function(event) {
  VanillaTilt.init(document.querySelectorAll(".cardglass, .creditcardglass, .wixui-creditcardglass"), {
    max: 25,
    speed: 400,
    glare: true,
    "max-glare": 1,
  });
});

from vanilla-tilt.js.

micku7zu avatar micku7zu commented on June 9, 2024

I will close the issue as this is not related to the library. The library works, you have to include it correctly.

from vanilla-tilt.js.

renanmalato avatar renanmalato commented on June 9, 2024

from vanilla-tilt.js.

micku7zu avatar micku7zu commented on June 9, 2024

from vanilla-tilt.js.

renanmalato avatar renanmalato commented on June 9, 2024

from vanilla-tilt.js.

renanmalato avatar renanmalato commented on June 9, 2024

from vanilla-tilt.js.

renanmalato avatar renanmalato commented on June 9, 2024

I believe now it went,
should be available tomorrow
let me know if all good

email: [email protected]

Screen Shot 2024-01-01 at 2 30 46 PM

from vanilla-tilt.js.

micku7zu avatar micku7zu commented on June 9, 2024

Thanks! I've got them. First donation/money related to vanilla-tilt.js in 8 years, after 3.7k Github stars and 2m downloads on NPM.

from vanilla-tilt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.