2

I might be approaching this the wrong way, but, I'm trying to start a jquery joyride (plugin) with the click of a div. But for some reason, it takes TWO clicks to fire it. -_- I've tried to think this over logically, but I can't figure it out. Someone help me out? Explain it to me?

I do realize that joyride is a function itself and therefore might be "function-ception" with the function click handler... Still should fire it without a second click though.

Thanks.

//clickable div
<div id="takeTheTour" class="clickable">need help? click to take the on-screen tour.</div>

//JS trigger
<script>
$(document).ready(function(e) {
    $("#takeTheTour").click(function(e) {
        $("#TourList").joyride()
    });
});
</script>
James_1x0
  • 931
  • 10
  • 20

1 Answers1

6

I had the same issue. You need to set the autoStart property. This fixed it for me:

$("#TourList").joyride({ autoStart : true });

Hope this helps!

Opi
  • 183
  • 2
  • 12
  • Could have been documented by them! Lol. Now I can pickup the project again. Lol Thanks. – James_1x0 Sep 20 '13 at 16:36
  • This is the solution I needed for the same plugin. I'm finding they haven't documented a lot of things. I had another issue [**here**](http://stackoverflow.com/questions/19011243/zurb-joyride-not-following-defined-order/19014392?noredirect=1#comment28104869_19014392) that you might be interested in, should you need it. – Millhorn Sep 26 '13 at 14:10
  • @webfrogs: Even if they had documented things, wouldn't the param "autoStart" be a little... how do I say it... misleading? – James_1x0 Sep 30 '13 at 20:26
  • this works for me, but for some reason when I click the button a second time, the modal background doesn't show the first time. Anyone had this problem? (here's my question: http://stackoverflow.com/questions/23331365/zurb-joyride-modal-background-doesnt-show-until-after-first-click) – evan Apr 29 '14 at 17:40