Giter VIP home page Giter VIP logo

wow's Introduction

WOW.js Build Status

Temporary deprecation:

wow.js is temporarily deprecated in favour of AOS (Animate on Scroll). Feel free to ignore the warning if you can't use AOS.

Plans for 3.0 include:

  • Breaking out the shims into an optional module
  • Using the AOS approach for most functionality
  • Remain completely backwards compatible and a drop-in replacement for GPL wowjs, but issue warning on durations of higher granularity than 50ms or longer than 3s
  • Detect Firefox for Android as mobile.

Reveal CSS animation as you scroll down a page. By default, you can use it to trigger animate.css animations. But you can easily change the settings to your favorite animation library.

Advantages:

  • 100% MIT Licensed, not GPL keep your code yours.
  • Naturally Caffeine free
  • Smaller than other JavaScript parallax plugins, like Scrollorama (they do fantastic things, but can be too heavy for simple needs)
  • Super simple to install, and works with animate.css, so if you already use it, that will be very fast to setup
  • Fast execution and lightweight code: the browser will like it ;-)
  • You can change the settings - see below

Live examples

Documentation

It just take seconds to install and use WOW.js! Read the documentation ➫

Dependencies

Installation

  • Bower
   bower install wow-mit
  • NPM
   npm install wow.js

Basic usage

  • HTML
  <section class="wow slideInLeft"></section>
  <section class="wow slideInRight"></section>
  • JavaScript
new WOW().init();

Advanced usage

  • HTML
  <section class="wow slideInLeft" data-wow-duration="2s" data-wow-delay="5s"></section>
  <section class="wow slideInRight" data-wow-offset="10"  data-wow-iteration="10"></section>
  • JavaScript
var wow = new WOW(
  {
    boxClass:     'wow',      // animated element css class (default is wow)
    animateClass: 'animated', // animation css class (default is animated)
    offset:       0,          // distance to the element when triggering the animation (default is 0)
    mobile:       true,       // trigger animations on mobile devices (default is true)
    live:         true,       // act on asynchronously loaded content (default is true)
    callback:     function(box) {
      // the callback is fired every time an animation is started
      // the argument that is passed in is the DOM node being animated
    },
    scrollContainer: null,    // optional scroll container selector, otherwise use window,
    resetAnimation: true,     // reset animation on end (default is true)
  }
);
wow.init();

Asynchronous content support

In IE 10+, Chrome 18+ and Firefox 14+, animations will be automatically triggered for any DOM nodes you add after calling wow.init(). If you do not like that, you can disable this by setting live to false.

If you want to support older browsers (e.g. IE9+), as a fallback, you can call the wow.sync() method after you have added new DOM elements to animate (but live should still be set to true). Calling wow.sync() has no side effects.

Contribute

The library is transpiled using Babel, please update wow.js file.

We use grunt to compile and minify the library:

Install needed libraries

npm install

Get the compilation running in the background

grunt watch

Enjoy!

Bug tracker

If you find a bug, please report it here on Github!

Developer

Originally Developed by Matthieu Aussaguel, mynameismatthieu.com Forked to remain under the MIT license by Thomas Grainger, https://graingert.co.uk

Contributors

Thanks to everyone who has contributed to the project so far:

Initiated and designed by Vincent Le Moign, @webalys

wow's People

Contributors

attilaolah avatar bouki avatar bradcerasani avatar dandv avatar daynin avatar graingert avatar joshmatz avatar kkirsche avatar kyleneedham avatar matthieua avatar mdeboer avatar mikelambert avatar moox avatar peterdavehello avatar phillipalexander avatar psorensen avatar ramasilveyra avatar tagrendy avatar taylorstine avatar tomasdev avatar webalys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wow's Issues

Only load animations on window focus

I want to load the animation only when the window or tab is focused. I don't want the animations to star immediately when I open the page on a new tab. Is there a way to do that? Thanks in advance.

WOW is not defined in Wordpress

Hello friends,

I have been trying to use WOWjs in a Wordpress Theme but trying different ways (putting it in a script in the body, in the header, in a separate js file, putting it in the footer) EVERYTHING has been unsuccessful. You keep getting the error that WOW is not defined. I hope you can help me.
Screenshot_2
Screenshot_3
Screenshot_4
Super Thank You!

Don't animate hidden elements

I have some parts of the website that are only visible on mobile, the Hide classes are with visibility: none, but because I have the wow class on the children elements in order to animate them, it makes them visible on desktop as well. Since I have reached the section it puts visibility: visible;
I do not wish to change the Hide classes to use display: none, I prefer the Visibility one. Is there any way around this?

Can not run in Animate.css (V4.1.1)

I try to use wow.js with animate.css, how ever, it not works when I use CDN Link from official site of animate.css.
But when I use old version, it works.

MIT license

Can someone clarify for me the license of this library. Is it MIT?
Why is the site UpLabs charging for a license?

Animate on hover

Animations are revealing correctly on scroll, but can we make them animate on hover?

Would be good for buttons etc.

Have tried this (and similar variations) without luck:

.button-element:hover {
animation: jackInTheBox 2s;
}

Not working with latest animate.css?

Hi there.

I have tried to use it with https://raw.githubusercontent.com/daneden/animate.css/master/animate.css but it did not work.

I have copied https://wowjs.uk/css/libs/animate.css and looks like it's working.

Any ideas on this?

Ty!

Uncaught Type Error when mobile false enabled

Everything loads fine on desktop but when the mobile: false setting is set in the init code, I get the following error:

"Uncaught TypeError: this.boxes.push is not a function" from wow.js:1:4068

The init code is:
(function ($) {
new WOW({offset: 100, mobile: false}).init();
})(jQuery);

New version AnimateJS

Hi! A new version of animate.js has been released, I think it's time for you to update too!

WHY IS THIS MIT LICENSED?

"The UpLicense gives you the right to use an product purchased from the Uplabs Store for personal use or as part of a commercial project, for yourself or a third party. However, the product cannot be redistributed for free or sold, on its own or in a bundle, where it constitutes the core value of the end product."
IMO, this is illegal distribution of wow.js. I dont understand the law basis of this. Why the website also copy original site? Any clarification? Did I just accidentally steal software?

wow is not playing once when we hide then show the elements

the page loads and the animation plays and finishes.. expected not to animate again

for a certain reason i need to display none the wrapper of one of the animated elements and show it back on a certain condition..

when i show it back the animation inside this wrapper plays again..

how can i stop this behavior??

how can we for example add a class that stops any attempt of the animation after that the element has already animated..

callback

I use wow to animates few element on my page with success.

I wish to use wow to trigger other js functions when item are visible.
I try to use callback option but it doesn't seams to work

var wow = new WOW(
    {
      callback:     function(box) {
        // the callback is fired every time an animation is started
        // the argument that is passed in is the DOM node being animated
        console.log("!! WOW !!");
      }
    }
  );
  wow.init();

the animations are triggered, but nothing is logged

How to use wow to activate css animations on scroll?

I have some percentage circles on my page and they are further down the page as a lot of content is above it - e.g;

lots of content pushing the circles down the page so that you can't see them
circles I'm trying to animate on scroll
I would like to know how to use wow to be able to activate the circle's animation when I scroll down to them as at the moment they are activating when I cannot see them.

My code is here: https://codepen.io/digitalbydefault/pen/LJYPXw

Please, can anyone point me in the right direction?

thanks

wrongly positioning the content of website while scrolling on mobile devices.

When we scroll the webpage having wow animations, while loading animations of the content, the website components get place wrongly , leaving a big temporary offset on X direction. when the animation gets completed , they get back to their desirable position again. This makes the website ugly on mobile devices, and We would like to have animations on mobile site.

Doubts about License

Hello @graingert

First of all I have to say that my knowledge about licenses is practically inexistence.

I have found your code by googling. I have to say that it's works nicely. But reading your readme i look that you "forked" the code from another repository, that repository have a payment license but yours is MIT(Which I think that is free to use)..

How it can be?

Thanks for your work!
Greetings.

Add the "duration" option

Please, add the possibility to specialize an animation duration as an option in WOW object arguments.

.animated class clashes with bootstrap modal

"animation-fill-mode: both" attribute clashes with the boostrap 3 modal popups.

It causes the class "modal-backdrop" to appear in front of all the others

image

If you remove the css attribute, it causes the content to flicker once before loading.

n.b. I am using animate.css along with wow js.

Any solutions?

not working when Content-Security-Policy is implemented

hello, can i put the init-Code directly into the js instead in a script tag? wow does not run since i implemented a csp header because the init-code is recognized as an inline script which are ignored. I am not used in js, so, if it is possible, i would need the whole lines to put in with all the ({; and so on
Can anybody helpp me? Thanks in advance, Silke

JS.ORG ToS § 3 Termination

I herby inform you about the Termination of the provisioned subdomain (wow.js.org). The subdomain will be removed in 7 days. see ToS $3 3 :

JS.ORG may also terminate the provision of a certain or all subdomains. Concerned users will be notified at least 7 days in advance by an issue in their GitHub repository

migrate Animate.css v4

A few days ago, 'Animate.css' was updated to v4 with breaking changes.

https://github.com/animate-css/animate.css/releases/tag/v4.0.0

The difference with v3 are as below:
. add prefix to all classnames.
(fadeIn -> animate__fadeIn, animated -> animate__animated, and more...)

. utility attributes was changed to utility classnames.
(ig. delay attribute was changed to 'animate__delay-2s' class )

I'm trying to implement them now, please just moments. ( When done, I'll make a pull-request. )

SSR support?

Hi!
I'm trying to use wowjs in React app and everything was fine, until I moved the project to SSR.
Since on server we have no window object it says:

/client/node_modules/wowjs/dist/wow.js:336
      if ('requestAnimationFrame' in window) {
                                     ^

ReferenceError: window is not defined

Is there any possibility to review the lib and include SSR support?

Viewport Overflow-X (Horizontal Scrolling): how to solve it via wow.js?

I just started using wow.js and testing it in my mobile browser I noticed that the viewport becomes larger creating a horizontal scroll. I think the reason for the overflowing is that the animations like fadeInLeft, fadeInRight and similar ones start outside of the viewport.

1 - Viewport bug: On mobile browsers the width becomes larger than 100%.
Wow - Overflowing Viewport - 1

2 - To solve it I add some lines in my CSS to hide the overflow-x of the <body>.
Wow - Overflowing Viewport - 2

This solve the problem, but I wouldn't like to do a MacGyver on every page I create. In animate-plus.js, for example, this behavior is defined right in the JS file to avoid quick fix in CSS. So my question is:
Is there a way to solve it directly in WOW.JS ?

Best regards,
Jaris GV

Uncaught TypeError why is showing this error while calling new WOW().init();

Hi Team,
I'm Using React JS
while calling this function
new WOW().init(); showing error like this

image

I'm Using Script and Css File

<script src="https://cdnjs.cloudflare.com/ajax/libs/wow/0.1.12/wow.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.0/animate.min.css" />
How to Resolve this Issue

Plugin not working with latest version of animate css 4.1.0

I tried using WOW.js with the latest version 4.1.0 of animate.css from cdn.js and it didn't work, had to revert to an earlier version of animate.css (3.7.2) as I had used it in an earlier project.

Just for the sake of future users.
Love the work you guys put in to get it free for all to Use.
This is just my little way of saying thank you :)

J.D Braide

WOW in Vue

Hello author,
In an asynchronous request in Vue, when I jump back to the previous page, WOW has no way to execute the animation immediately, but needs to have a scroll before the animation is executed.
Is there a way to perform CSS animation immediately after initialization?
I've tried it in mounted(), activated(), and $nextTick(), and I can't perform CSS animations immediately after returning to the previous page.

Thank you

@graingert I just wanted to thank you for this great drop-in replacement for npm package wowjs, which had me scratching my head all afternoon. After installing your fork wow.js everything worked like a breeze in my react/webpack app. Thanks for your hard work.

In bootstrap 4, size md, elements are not displayed

Hello, I have this:

<div class="container">
	<div class="row">
		<div class="col-lg-6">
			<p>This text displays fine.</p>
		</div>
		<div class="col-lg-6">
			<p>This text also displays fine.</p>
			<p>In the image below, if I remove the wow class, I can see the image.
			   If I leave the wow class, the image is not displayed only when the
			   size of the window is md, for example, 977px wide.</p>
			<img src="some-image.jpg"
				class="img-fluid center-block wow fadeInRightBig"
				data-wow-delay="0s"
				data-wow-duration="1s"
				data-wow-offset="200"
				alt="Some image" />
		</div>
	</div>
</div>

In the image some-image.jpg, if I remove the wow class, I can see the image.

If I leave the wow class, the image is not displayed only when the size of the window is md, for example, 977px wide.

I tried removing the img-fluid and center-block classes but it still doesn't work.

It works fine in Bootstrap 3, the problem is only with bootstrap 4. I am using the latest version of wow.min.js and animate.css and bootstrap 4. Thanks.

Annoying flickering: Content showed before the animation

Hy guys,

I'm having this annoying effect where the div is shown before the animation starts resulting in an annoying effect. Look at this:

WOW-480

I'm using the default settings and these are the relevant DOM elements:

          <div class="about-image wow fadeInRightBig text-center" data-wow-duration="1s" data-wow-delay="0s"
               style="z-index: 90; filter: drop-shadow(0 0 30px #333);">
            <img...>
          </div>
        
          <div class="text-center wow fadeInUp" data-wow-duration="1.3s" data-wow-delay="0s">

is that normal or is there something that goes in conflict? Thanks.

Run the animation only once

Hello, is there a way to make sure that the animation runs only once?

I have tried using data-wow-iteration="1" but it didn't work.

What about wow when JS fails?

To prevent elements from 1st showing, then disappearing and then appearing again (animation) when using wow, I added the CSs line: .wow { visibility:none;}

However, this causes elements to stay hidden when JS fails or disabled in browser. For that, I created this little / script function:

<!-- wow backup -->
<noscript><style>.wow {visibility: initial;}</style></noscript>
<script>window.onload=function(){elem = document.querySelector('.wow');style = getComputedStyle(elem);if (style.visibility=='hidden') {style = document.createElement('style');document.head.appendChild(style);style.sheet.insertRule('.wow { visibility:initial;}');}}</script>

how to reset animation

I want to reveal animation , but there is a problem:
after animated, the wow elements area all visible,
then scroll down ,
then scroll back , re init wow again ,
the wow elements is firstly visible and then animate

Bug. Big viewport

If the window size is high enough, then the objects that are in viewport will not be animated until the window size is reduced. This can be tracked if you open the site from your phone (full version of the site in your mobile browser)
Video:
https://yadi.sk/i/paifxQ7B7Xg2UQ

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.