开发者

Open links in current tab of JQuery UI Tabs

开发者 https://www.devze.com 2022-12-09 11:39 出处:网络
The code from official website seems only binds click event to links at first load. When a new page is loaded, all links seem 开发者_如何学Pythonto be unbinded so any further clicks will leave the pag

The code from official website seems only binds click event to links at first load. When a new page is loaded, all links seem 开发者_如何学Pythonto 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?


try live:

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

精彩评论

暂无评论...
验证码 换一张
取 消