joyride icon indicating copy to clipboard operation
joyride copied to clipboard

Link for a button

Open PierreLechelle opened this issue 11 years ago • 4 comments

I would like to be able to add a link to a button.

This could led for instance, to redirect users to a new page after the last step of the tour.

PierreLechelle avatar Apr 10 '13 17:04 PierreLechelle

I was exactly trying to do this right now. +1

djmarcos88 avatar Apr 22 '13 20:04 djmarcos88

It seems impossible without modifying the source code :(

PierreLechelle avatar Apr 23 '13 11:04 PierreLechelle

I actually could do it. It's quite obnoxious though. You have to give an instruction modal a css class, use that class to hide de next step button (the default button) and then write your own button inside that instruction modal (inside the

  • ), with the href that you want. Of course you also have to put the same styling to that custom button in order for it to look exactly as the default buttons.
  • djmarcos88 avatar Apr 23 '13 13:04 djmarcos88

    Glad I found this thread, I was having a similar issue, and adding a single call to add a hidden class to the automatically generated buttons wasn't working reliably for me, so below is the solution I was able to get working pretty easily using the pre_step_callback:

    $(document).foundation({
        joyride: {
            modal: false, 
            pre_step_callback: function(){
                //Preemtively hide autogenerated next buttons as needed
                $('.joyride_next_hidden .joyride-content-wrapper .joyride-next-tip').addClass('hide');
            }
        }
    });
    

    With my joyride tooltip markup looking like...

    <li data-id="your-id" class="joyride_next_hidden">
        <h4>Ready to hide a button?</h4>
        <p>Put your link in the button below...</p>
        <a href="http://google.com" class="small button">Go to link</a>
    </li>
    

    bennettstone avatar Jul 14 '14 14:07 bennettstone