Это мой css:
ul.tabs {
list-style:none;
margin: 0!important;
padding:0;
border-bottom:0px solid #666;
height:30px;
}
/* single tab */
ul.tabs li {
float:left;
text-indent:0;
padding:0;
margin:0 !important;
list-style-image:none !important;
}
/* link inside the tab. uses a background image */
ul.tabs a {
background-color: #000000;
font-size:12px;
display:block;
height: 30px;
line-height:30px;
width: 134px;
text-align:center;
text-decoration:none;
color:#FFFFFF;
padding:0px;
margin:0px;
position:relative;
background-image: url();
background-repeat: no-repeat;
background-position: -420px 0;
font-family: arial;
font-weight: bold;
text-transform: uppercase;
}
ul.tabs a:active {
outline:none;
}
/* when mouse enters the tab move the background image */
ul.tabs a:hover {
background-position: -420px -31px;
color:#fff;
}
/* active tab uses a class name "current".
its highlight is also done by moving the background image. */
ul.tabs a.current, ul.tabs a.current:hover, ul.tabs li.current a {
background-position: -420px -62px;
cursor:default !important;
color:#000 !important;
}
/* initially all panes are hidden */
.panes .pane {
display:none;
}
.panes div {
display:none;
padding:15px 10px;
border:medium solid #000000;
height:150px;
font-size:14px;
background-color: #0099FF;
}
Это мой HTML:
<div class="panes">
<div>working pane 1</div>
<div>working pane 2</div>
<div>working pane 3</div>
</div>
<ul class="tabs">
<li><a href="#">Working Tab1</a></li>
<li><a href="#">Working Tab2</a></li>
<li><a href="#">Working Tab3</a></li>
</ul>
<p>
<div class="Next Set of Tabs I want to work">
<ul class="tabs">
<li><a href="#">tab 1</a></li>
<li><a href="#">tab 2</a></li>
</ul>
<div class="Next Set of Panes I want to work">
<div>member pane 1</div>
<div>member pane 2</div>
<div>member pane 3</div>
</div>
</div
и это мой javascript:
// perform JavaScript after the document is scriptable.
$(function() {
// setup ul.tabs to work as tabs for each div directly under div.panes
$("ul.tabs").tabs("div.panes > div");
});
</script>
Как мне создать 2-й и 3-й набор вкладок и панелей, которые я могу использовать в другом месте моего документа? Я попробовал некоторые свои правки, но потерпел неудачу.
Кроме того, какие изменения я должен внести в свой JavaScript, чтобы он работал для добавленных вкладок и панелей в дополнение к текущей?
Пожалуйста, ответьте с примером в коде. Заранее спасибо.