0

I've written a website tour with the jQuery plugin Feature Walkthrough

<button id="yui-galleryintrotourui-buttontourend-id" class="yui-galleryintrotourui-card-next yui3-button notice" data-seqid="end"> … </button>

This is pretty much how I'm currently attempting to check if the jQuery function introTour has finished, tour_cards example is available on the website.

$().introTour(tour_cards, function(){
    alert("Finished");
});

I've tried using a .live('click', function(){}); event to pick up, the click event once it has been made on the yui-galleryintrotourui-buttontourend-id, but it doesn't do anything (I think, it is because, these events must be added before the elements are added to the DOM itself).

classicjonesynz
  • 4,012
  • 5
  • 38
  • 78

2 Answers2

1

Because closeIntro() effectively does this ...

$(".yui-galleryintrotourui-card").css("display","none");

You could actively poll for the visibility of .yui-galleryintrotourui-card like so ...

var isTourOver = setInterval(function(){


    if($('.yui-galleryintrotourui-card:visible').length == 0){

        // The Tour is over!
        clearInterval(isTourOver);
    }

}, 100);
Mike Vysocka
  • 194
  • 1
  • 1
1

Ive just added two events you can subscribe to https://github.com/nbprithv/introtour-ui#events

I hope this helps.

This is available on the jQuery plugin. Ill be updating the YUI plugin with this soon.

Thanks for checking out my work.

nbprithv
  • 46
  • 4