0

I have a website that displays the titles of TV shows, ordered by season. I'd like to implement a UI where the user is able to switch between seasons of a show by switching tabs For example, the "Season 1" tab would show the titles of all the shows from the first season, the "Season 2" tab would show the titles of all the shows from the second season, etc. The DB is structured as an episodes table with title, show_id (id of the TV show), and sezon(season number).

<div class="demo" id="tabs">
<ul>

<?$season=mysql_query("select * from seasons where showid='$ids' ORDER BY sezon ASC");

while($szn=mysql_fetch_array($season)){?>

<li><a href="#tabs-<?=$szn['sezon'];?>">Season <?=$szn['sezon'];?></a></li>

<?}?>

</ul>

<div id="tabs-<?=$szn['sezon'];?>">episodetitle</div>
</div>

How can I implement the tab switching correctly?

4

1 回答 1

1

我认为最简单的方法是 jQuery。在 jQuery UI 中有一个特定的东西。

http://jqueryui.com/tabs/

阅读示例下方的文档。(有一段代码可以让理解更容易。)

当我阅读您的代码时,它非常适合 jQuery UI 中的选项卡。

于 2012-11-03T18:58:54.540 回答