Giter Club home page Giter Club logo

Comments (5)

michalsnik avatar michalsnik commented on May 27, 2024 1

Though, it's worth making it possible to initialize on document ready as well. It'll probably save some headaches with settings this up. I'll consider this in future releases.
Thanks for your contribution @alex9pro !

from aos.

michalsnik avatar michalsnik commented on May 27, 2024

Hi, It's because AOS listens for DOMContentLoaded event and when you init AOS on document ready, the event is not triggered again, so AOS is not going to be initialized.

Put AOS.init() outside document ready and it'll work fine.

You can also set different start event:

AOS.init({
   startEvent: 'yourEvent'
});

and now you can trigger yourEvent on document whenever you want and AOS will be initialized.

For example:

AOS.init({
  startEvent: 'yourEvent'
});

$(document).on('ready', function() {
  $(document).trigger('yourEvent');
});

from aos.

michalsnik avatar michalsnik commented on May 27, 2024

Good news @alex9pro, I fixed it while making AOS compatible with different module systems (#14), as this change was necessary to make AOS work as AMD module.

from aos.

oleksapro avatar oleksapro commented on May 27, 2024

@michalsnik, that is good news, thank you

from aos.

michalsnik avatar michalsnik commented on May 27, 2024

It will be available in version 1.2.0

from aos.

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.