我有以下我想在当前工作日打开的工作日 jQuery UI 选项卡:
<div id="tabs">
<ul>
<li><a href="monday.php">Monday</a></li>
<li><a href="tuesday.php">Tuesday</a></li>
<li><a href="wednesday.php">Wednesday</a></li>
<li><a href="thursday.php">Thursday</a></li>
<li><a href="friday.php">Friday</a></li>
<li><a href="saturday.php">Saturday</a></li>
<li><a href="sunday.php">Sunday</a></li>
</ul>
<script type="text/javascript">
$(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. " +
"If this wouldn't be a demo." );
}
}
});
});
</script>
我希望标签在一周的当前一天打开,我知道这样的工作:
.eq((new Date().getDay() || 7) - 1).click();
但无法让它工作,并希望得到一些帮助。另外,我希望当天的标签显示“今天”而不是工作日。
我会很感激一些帮助。
谢谢,
布伦登