所以,我正在使用 jQuery UI(带有标签)来为我的页面上的一些内容添加标签。但是,有一个奇怪的问题正在发生。
我有两个标签,“KR”和“O”——当我点击“O”标签时,我确实得到了正确的内容。但是,如果我单击“KR”选项卡,我会同时获得 KR 和 O?检查下面的图片进行审查。
这是 PHP/HTML 代码,
<div id="right_side_menu">
<div id="sub_menu">
<ul>
<?php if($money_type == TRUE) : ?><li><a href="#tab-coins"><span>Kr</span></a></li> <?php endif ?>
<?php if($tasks_type == TRUE) : ?> <li><a href="#tab-hours"><span>O</span></a></li> <?php endif ?>
<?php if($hours_type == TRUE) : ?> <li><a href="#tab-tasks"><span>T</span></a></li> <?php endif ?>
</ul>
</div> <!-- end sub_menu -->
<div class="clear"></div>
<br />
<div id="statistics">
<?php if($money_type == TRUE) : ?>
<div id="tab-coins">
<ul>
<li><span id="statistics_big"> <?php if($total_year_money == FALSE) { echo '0'; } else { echo $total_year_money; } ?> </span><br><span class="statistics_underline">Kroner totalt i år</span></li>
<div class="clear"></div>
<li><span id="statistics_medium"> <?php if($total_month_money == FALSE) { echo '0'; } else { echo $total_month_money; } ?> </span><br><span class="statistics_underline">Kroner denne måneden</span></li>
<div class="clear"></div>
<li><span id="statistics_small"> <?php if($total_highest_money == FALSE) { echo '0'; } else { echo $total_highest_money; } ?> </span><br><span class="statistics_underline">Høyest salg denne måneden</span></li>
</ul>
</div> <!-- end tab-coins -->
<?php endif ?>
<?php if($hours_type == TRUE) : ?>
<div id="tab-hours">
<ul>
<li><span id="statistics_big"> <?php if($total_year_hours == FALSE) { echo '0'; } else { echo $total_year_hours; } ?> </span><br><span class="statistics_underline">Timer totalt i år</span></li>
<div class="clear"></div>
<li><span id="statistics_medium"> <?php if($total_month_hours == FALSE) { echo '0'; } else { echo $total_month_hours; } ?> </span><br><span class="statistics_underline">Timer denne måned</span></li>
<div class="clear"></div>
<li><span id="statistics_small"> <?php if($total_highest_hours == FALSE) { echo '0'; } else { echo $total_highest_hours; } ?> </span><br><span class="statistics_underline">Høyest antall timer denne måneden</span></li>
</ul>
</div> <!-- end tab-coins -->
<?php endif ?>
<?php if($tasks_type == TRUE) : ?>
<div id="tab-tasks">
<ul>
<li><span id="statistics_big"> <?php if($total_year_tasks == FALSE) { echo '0'; } else { echo $total_year_tasks; } ?> </span><br><span class="statistics_underline">Arbeidsoppgaver totalt i år</span></li>
<div class="clear"></div>
<li><span id="statistics_medium"> <?php if($total_month_tasks == FALSE) { echo '0'; } else { echo $total_month_tasks; } ?> </span><br><span class="statistics_underline">Arbeidsoppgaver denne måneden</span></li>
<div class="clear"></div>
<li><span id="statistics_small"> <?php if($total_highest_tasks == FALSE) { echo '0'; } else { echo $total_highest_tasks; } ?> </span><br><span class="statistics_underline">Høyest arbeidsoppgaver denne måneden</span></li>
</ul>
</div> <!-- end tab-coins -->
<?php endif ?>
<div class="clear"></div>
</div>
</div> <!-- end right side menu -->
这是实时输出,
<div id="right_side_menu">
<div id="sub_menu">
<ul>
<li><a href="#tab-coins"><span>Kr</span></a></li> <li><a href="#tab-hours"><span>O</span></a></li> </ul>
</div> <!-- end sub_menu -->
<div class="clear"></div>
<br />
<div id="statistics">
<div id="tab-coins">
<ul>
<li><span id="statistics_big"> 0 </span><br><span class="statistics_underline">Kroner totalt i år</span></li>
<div class="clear"></div>
<li><span id="statistics_medium"> 0 </span><br><span class="statistics_underline">Kroner denne måneden</span></li>
<div class="clear"></div>
<li><span id="statistics_small"> 0 </span><br><span class="statistics_underline">Høyest salg denne måneden</span></li>
</ul>
</div> <!-- end tab-coins -->
<div id="tab-tasks">
<ul>
<li><span id="statistics_big"> 0 </span><br><span class="statistics_underline">Arbeidsoppgaver totalt i år</span></li>
<div class="clear"></div>
<li><span id="statistics_medium"> 0 </span><br><span class="statistics_underline">Arbeidsoppgaver denne måneden</span></li>
<div class="clear"></div>
<li><span id="statistics_small"> 0 </span><br><span class="statistics_underline">Høyest arbeidsoppgaver denne måneden</span></li>
</ul>
</div> <!-- end tab-coins -->
<div class="clear"></div>
</div>
</div> <!-- end right side menu -->
我使用的 JavaScript,
<script>
$(function() {
$( "#right_side_menu" ).tabs();
});
</script>