リモート コンテンツの読み込みに最適な jQuery タブ要素があります。
ただし、カスタム JavaScript を呼び出す「リセット」という別のボタンを追加したいと考えています。私は jQuery を初めて使用しますが、それが大好きで、これを行う方法がわかりません。
現時点でタブを作成している .js は次のとおりです。これは jQuery サイトのデフォルトです。
$(document).ready(function() {
$( "#tabs" ).tabs({
ajaxOptions: {
error: function( xhr, status, index, anchor ) {
$( anchor.hash ).html(
"Couldn't load this tab. We'll try to fix this as soon as possible.");
}
}
});
});
次に、私のPHPには次のものがあります。新しい「リセット」タブにカスタム アクションを追加したい。
<div id="tabs">
<ul>
<li><a href="#map_canvas" title="content">Home</a></li>
<li><a href="test.php" title="content">How this works?</a></li>
<li><a href="test.php" title="content">View this at home</a></li>
<li><a href="#reset" title="content">Reset</a></li>
</ul>
<div id="map_canvas">
</div>
</div>