EasyUI Forum
May 18, 2024, 05:56:18 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Something wrong with Tabs  (Read 10592 times)
slvu
Newbie
*
Posts: 4


View Profile Email
« on: August 22, 2012, 02:40:37 AM »


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.

Code:
  <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.

Code:
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
});
}
};
Logged
slvu
Newbie
*
Posts: 4


View Profile Email
« Reply #1 on: August 22, 2012, 02:42:09 AM »

i used the jquery-easyui-1.3.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: August 23, 2012, 05:14:47 AM »

It seems that there are no problems with the code. When clicking the tab title of panel, the panel would be opened not closed.
Logged
slvu
Newbie
*
Posts: 4


View Profile Email
« Reply #3 on: August 23, 2012, 06:29:15 PM »

oh,no...My god.

But the panel really opened and closed soon..... just one click, the actions followed.

It seems that there are no problems with the code. When clicking the tab title of panel, the panel would be opened not closed.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!