In my index.jsp, i used the tabs to show the content of tab1.jsp and tab2.jsp.
THE PROBLEM IS:
When i clicked the tabs(both tab1,tab2 )
the first time, the content would be shown in the center region,
BUT closed at once automaticly. and then it just work correctly.
Pls pay attention to the content in
RED COLOR. Thank you very much and Look forward to your reply
the coding is following.
<body class="easyui-layout" >
<div region="west" split="true" title="" style="width:160px;">
<p style="height:1px"></p>
<ul>
<li><a id="tab1" href="#" onclick="addTab('Tab1','tab1.jsp')">Tab1</a></li>
<li><a id="tab2" href="#" onclick="addTab('Tab2','tab2.jsp')">Tab2</a></li>
<li></li>
</ul>
</div>
<div region="center" title="" style="padding:5px;background:#eee;">
<div id="tabs" class="easyui-tabs" fit="true" border="false">
<div title="Welcome" style="padding:20px;">
<p>Welcome!</p>
</div>
</div>
</div>
</body>
There is a JS file, just like that.
function addTab(title, href) {
var tt = $('#tabs');
if (tt.tabs('exists', title)) {
tt.tabs('select', title);
} else {
if (href) {
var content = '<iframe scrolling="yes" frameborder="0" src="' + href + '" style="width:100%;height:100%;padding:0px;"></iframe>';
} else {
var content = 'waiting';
}
tt.tabs('add', {
title : title,
closable : true,
content : content,
selected: true
});
}
};