-1

I am using intro.js functionality across 3 different urls. I have limited it to show to users only the first time they load a page with:

unless $.cookie("firstview")? introJs().start()
$.cookie "firstview", "firstSet", expires: 365

But the one cookie prevents all subsequent urls from showing their intro.js for the first time. I tried:

unless $.cookie("page1")?
introJs(".page1").start()
$.cookie "page1", "firstSet", expires: 365, page: "/page1"

unless $.cookie("page2")?
introJs(".page2").start()
$.cookie "page2", "firstSet", expires: 365, page: "/page2"

But still only the first page will show. Any ideas?

fedosov
  • 1,989
  • 15
  • 26

1 Answers1

0

That's easy to implement.

First, you should show the introduction to user and then set a cookie to browser upon introJs.onexit() callback (see here), and when the user visited your page again, you can check the cookie to prevent showing the introduction again.

Afshin Mehrabani
  • 33,262
  • 29
  • 136
  • 201