当我点击。日期选择器无法进入新标签
这是代码
<script>
var tabCounter = 2,
tabTemplate = "<li><a href='#{href}'>#{label}</a> <span class='ui-icon ui-icon-close'>Remove Tab</span></li>";
var tabs = $( "#tabs" ).tabs();
var tabContentHtml = $("#tabs-1").html();
创建日期选择器。进入tab1。不适用于tab2
$( ".rush" ).datepicker();
单击按钮时添加新选项卡
$("#add_tab").click(function(){
addTab();
});
function addTab() {
var label = "Tab " + tabCounter,
id = "tabs-" + tabCounter,
li = $( tabTemplate.replace( /#\{href\}/g, "#" + id ).replace( /#\{label\}/g, label ) );
tabs.find( ".ui-tabs-nav" ).append( li );
tabs.append( "<div id='" + id + "'><p>" + tabContentHtml + "</p></div>" );
tabs.tabs( "refresh" );
tabCounter++;
}
</script>
代码html
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a> <span class="ui-icon ui-icon-close">Remove Tab</span></li>
</ul>
<div id="tabs-1">
<input type="text" class="rush" />
</div>
</div>
<button id="add_tab">Add Tab</button>