pandik70
pandik70

Reputation: 195

Hash navigation in Turn.js

I´ve been exploring turn.js script and after a long study of script hash.js I did not find the way how to make navigation across the flipbook. Like here

I don´t know how exactely am I supposted to create "url" for each page. Can somone advise me what should I google or if someone face the problem and will help me I would appreciate it so much.

Upvotes: 0

Views: 463

Answers (1)

pandik70
pandik70

Reputation: 195

I´ve added code:

Hash.on('^page\/([0-9]*)$', {
    yep: function(path, parts) {

        var page = parts[1];

        if (page!==undefined) {
            if ($('#flipbook').turn('is'))
                $('#flipbook').turn('page', page);
        }

    },
    nop: function(path) {

        if ($('#flipbook').turn('is'))
            $('#flipbook').turn('page', 1);
    }
});

Upvotes: 0

Related Questions