jack
jack

Reputation: 17881

Open links in current tab of JQuery UI Tabs

The code from official website seems only binds click event to links at first load. When a new page is loaded, all links seem to be unbinded so any further clicks will leave the page.

$('#example').tabs({
    load: function(event, ui) {
        $('a', ui.panel).click(function() {
            $(ui.panel).load(this.href);
            return false;
        });
    }
});

How to bind click events to links in every new page loaded into current tab?

Upvotes: 1

Views: 1399

Answers (1)

TheVillageIdiot
TheVillageIdiot

Reputation: 40497

try live:

    $('a', ui.panel).live('click', function() {
        $(ui.panel).load(this.href);
        return false;
    });

Upvotes: 3

Related Questions