V
V
Vlad2020-12-11 00:40:36
JavaScript
Vlad, 2020-12-11 00:40:36

WOW.js not working in Webpack, why?

Faced this problem, found this answer Why doesn't WOW.js work in Webpack?
I tried everything from the topic, and wowjs and wow.js - nothing works :(

Uncaught ReferenceError: WOW is not defined
...

even if you kill. I want to roll everything into one bundle, it doesn’t work ((

"dependencies": {
    ...
    "wow.js": "^1.2.2",
    "wowjs": "^1.1.3"
},
"devDependencies": {
"webpack": "^5.10.0"
...
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Dubrov, 2020-12-13
@victor1985

Good afternoon.
1. You install https://www.npmjs.com/package/wowjs
npm i wowjs
2. You import 3. You create an instance of the WOW class that has a WOW method, use it and initialize
import WOW from 'wowjs';

new WOW.WOW({
    live: false
   //и любые другие параметры - это просто пример
}).init();

4.Next you include animate.css And everything should work. Checked on the animation of the appearance, the element should leave from below.
import 'wowjs/css/libs/animate.css'
<div class="wow bounceInUp">
      Я появляюсь снизу
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question