Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intro.js not working for specific classes

Tags:

intro.js

I'm not able to start the intro for elements only with class 'case_event_intro' but when I do introJs(".case_event_intro").start(); nothing happens, even though there are elements with that class and with the intro att. defined (data-intro and data-step). The elements have also other classes apart case_event_intro. Could that be the problem? Are there any other conditions to make the intro work for only some elements with a given class?

See this screen capture.

like image 781
Fernando C Martinelli Avatar asked Jul 04 '26 01:07

Fernando C Martinelli


2 Answers

In current version of IntroJs (v0.3.0) you cannot start introduction for specific element with a class or something.

You should create a container element, and then start introduction for those elements like this:

<div class="case_event_intro">
    <div data-intro="Hello world" data-step="1">
        ...
    </div>
</div>

And then call:

introJs(".case_event_intro").start();
like image 59
Afshin Mehrabani Avatar answered Jul 06 '26 15:07

Afshin Mehrabani


Switch where you are adding the class.

introJs().start('.case_event_intro');
like image 45
Laura Avatar answered Jul 06 '26 15:07

Laura



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!