views:

35

answers:

1

I'm using the Tabs from jQuery Tools to create a wizard. I have prev and next buttons successfully navigating between the panes, but they don't change the hash and don't contribute to the browser history (at least not in FF). Do I have to add something to my next & prev handlers? Maybe change the location.href of the buttons to #<next-page-id>? I kind of thought the Tools would do that for me....

my.wizard = function() {
    var api;
    var $next, $prev;

    var init = function() {
        $next = jQuery('.wizardFoot .next').click(next);
        $prev = jQuery('.wizardFoot .prev').click(prev);

        // init the tabs
        jQuery(".wizardNav ol").tabs("div.wizardBody div.wizardPane", {
            history: true
        });

        api = jQuery(".wizardNav ol").data("tabs");
    };

    var next = function() {
        console.info('next');
        api.next();
        return false;
    };

    var prev = function() {
        console.info('prev');
        api.prev();
        return false;
    };

    return {
        init: init
    };
}();
A: 

Not sure too much about the plugin, but I wouldn't imagine it would offer out of the box support for url hashing. Anyway, to answer you're question, yep, you need to add the hash to the window.location.hash object. For example:

window.location.hash += '#hello';

Course, you'll want to append with the hashes for the panes in your wizard tool.

Brian Flanagan
it does do the hashing for the tabs. and it has a next() and prev() method, but, sadly, it doesn't seem to do the hash with those.
sprugman
Have a look at the documentation here: http://flowplayer.org/tools/demos/tabs/history.html#player_tabIt looks like you need to add id's to the anchor tags that make up the tabs and set the 'history' parameter to true.
Brian Flanagan