Comments (12)
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.
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.
Ok, at a quick look on this page, there are multiple issues:
- 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 - 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. .cardglass, .creditcardglass
- your element on the page doesn't have this classes. They are prefixed withwixui-
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.
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
from vanilla-tilt.js.
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.
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.
from vanilla-tilt.js.
from vanilla-tilt.js.
from vanilla-tilt.js.
from vanilla-tilt.js.
I believe now it went,
should be available tomorrow
let me know if all good
email: [email protected]
from vanilla-tilt.js.
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)
- How to reset the component? HOT 5
- Glare effect rectangle HOT 2
- New Today: Chrome (only) "transform: translateZ();" Defaulting to Zero After Parallax Mouse Movement HOT 1
- Need help
- Images wrapped in Picture ignore translateZ on Chrome & Firefox HOT 2
- Gyroscope Issue HOT 1
- Error when viewed over fixed element HOT 3
- Uncaught SyntaxError: Unexpected Identifier
- Opera on Fedora Linux bug HOT 3
- Glare On Text HOT 1
- glare doesnt work properly on border-radius elements HOT 1
- Documentation error - // What axis should be disabled. Can be X or Y. HOT 2
- Vanilla
- Glare effect not working on firefox HOT 1
- The compatibility of Pjax and vanilla-tilt.js HOT 2
- QuerySelectorAll makes the vanillaTilt.destroy function undefined HOT 1
- Glare element bounds are visible at certian sizes
- Add support for Typescript HOT 1
- Tilt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vanilla-tilt.js.