0

I am in the process of installing an outside JS plugin called intro.js https://github.com/usablica/intro.js3. According to the install instructions, the only files needed are intro.js and introjs.css and then a introJs().start(); call can be made.

Here is my environment setup :
1. The official jQuery meteor package is installed https://atmospherejs.com/meteor/jquery
2. intro.js file is inside a client/lib/js directory.
3. introjs.css file is inside a client/lib/stylesheets/ directory
4. since the js will span multiple pages my call is in body.onRendered like so :

Template.body.onRendered(function () {
    introJs().start();
});

Which does not work, but using a timeOut solves the issue :

Template.body.onRendered(function () {
    setTimeout(function() { introJs().start(); }, 5000);
});

Why does using a timeout solve the issue?
Is it possible to not use one? Is so, how?

Kyll
  • 7,036
  • 7
  • 41
  • 64
Alex P
  • 407
  • 6
  • 15

0 Answers0