Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joyride requires hash fragment? #204

Open
saibotsivad opened this issue Jul 15, 2015 · 2 comments
Open

Joyride requires hash fragment? #204

saibotsivad opened this issue Jul 15, 2015 · 2 comments

Comments

@saibotsivad
Copy link

I was attempting to use Joyride inside a web app, to show off new features, but like many single-page web apps, ours uses the hash fragment for navigation. E.g. site.com/#/company/123 to show the company page for the company id "1234".

After successfully got Joyride running, I now see that all the clickable actions (e.g. "next", "close", etc.) are actually <a> elements, with the href attribute containing a hash fragment. E.g. <a href="#close">X</a> for the close action.

Is there any way to override this? It looks pretty integral to Joyride, but using hash fragments effectively rules out using Joyride for web apps like ours, since they use the hash fragment for application routing.

@saibotsivad
Copy link
Author

I'm not sure if there is a better way, but I resolved this in AngularJS by doing this:

var element = $('#' + slide.id);
element.joyride(options);
element.joyride(options);
$timeout(function() {
    $('.joyride-tip-guide a[href]').each(function() {
        $(this).click(function(event) {
            event.preventDefault();
        })
    })
})

(Running joyride twice because of #200)

@robinfhu
Copy link

robinfhu commented Feb 1, 2017

Yes you can override this. You should be able to change the outer HTML of the close button and next button in the settings:

$('#tutorial').joyride({
    template: {
        'link': '<a href="javascript:void(0);" class="joyride-close-tip">X</a>',
        'button': <a href="javascript:void(0);" class="joyride-next-tip"></a>'
    }

})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants