Heim  >  Artikel  >  Web-Frontend  >  Bedienung von Tabs in js

Bedienung von Tabs in js

一个新手
一个新手Original
2017-10-16 09:07:213122Durchsuche

<!--tabs 选项卡--><h1>tabs 选项卡</h1><!--tabs 选项卡:动态添加选项卡--><p style="margin-bottom:10px"> <a href="#" class="easyui-linkbutton" onclick="addTabB(&#39;google&#39;,&#39;http://www.google.com&#39;)">google</a> <a href="#" class="easyui-linkbutton" onclick="addTabB(&#39;jquery&#39;,&#39;http://jquery.com/&#39;)">jquery</a> <a href="#" class="easyui-linkbutton" onclick="addTabB(&#39;easyui&#39;,&#39;http://jeasyui.com/&#39;)">easyui</a></p>
<!--tabs 选项卡定义-->
<p id=&#39;tabsId&#39; class="easyui-tabs" style="width:500px;
    height:250px;
    "> <p title="Tab1" style="padding:20px;
    display:none;
    "> tab1 </p> <p title="Tab2" data-options="closable:true" style="overflow:auto;
    padding:20px;
    display:none;
    "> tab2 </p> <p title="Tab3" data-options="iconCls:&#39;icon-reload&#39;,closable:true" style="padding:20px;
    display:none;
    "> tab3 </p> </p>
//动态添加选项卡方法function addTab(title, url) {
    if ($(&#39;#tt&#39;).tabs(&#39;exists&#39;, title)) {
    $(&#39;#tt&#39;).tabs(&#39;select&#39;, title);
}
else {
    var content = &#39;<iframe scrolling="auto" frameborder="0" src="&#39;+url+&#39;" style="width:100%;
    height:100%;
    "></iframe>&#39;;
    $(&#39;#tt&#39;).tabs(&#39;add&#39;, {
    title:title, content:content, closable:true }
);
}
}

Das obige ist der detaillierte Inhalt vonBedienung von Tabs in js. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn