$(document).ready(function () { $('#tt').tabs(); $('#tt').tabs('add', { title: 'tab1 ', closable: true, content: '<iframe scrolling="yes" frameborder="0" src=http://topic.csdn.net/u/20110524/17/"Demo-MainFrame01.jsp?type=0" style="width:100%;height:100%;"></iframe>', selected: true }); $('#tt').tabs('add', { title: ''tab2 ', closable: true, content: '<iframe scrolling="yes" frameborder="0" src=http://topic.csdn.net/u/20110524/17/"Demo-MainFrame01.jsp?type=1" style="width:100%;height:100%;"></iframe>' }); $('#tt').tabs('add', { title: ''tab3', closable: true, content: '<iframe scrolling="yes" frameborder="0" src=http://topic.csdn.net/u/20110524/17/"Demo-MainFrame01.jsp?type=1" style="width:100%;height:100%;"></iframe>' }); });
我想在第一次 点击TAB1时,触发一个事件,刷新TAB1里面的内容,点击第一次TAB2时,刷新TAB2里面的内容。该如何做?
选择tab可以在onSelect事件中处理:
$('#tt').tabs({
onSelect:function(title){
var p = $(this).tabs('getTab', title);
p.find('iframe').attr('src','...');
}
});