如果您知道我的意思,我想创建一个指向 jQuery 选项卡上的锚点的链接。我有一个页面,在该页面上锚定了两个选项卡#idTab1 和#idTab2。我使用 Sean Catchpole 的 jQuery idTabs,在这里... http://www.sunsean.com/idTabs/
这是我拥有的代码的模拟版本......
<div class="usual">
<ul class="idTabs">
<li><a name="idTab1" href="#idTab1" class="selected">Terms of Use</a></li>
<li><a name="idTab2" href="#idTab2">Privacy Policy</a></li>
</ul>
<div class="handbook" id="idTab1">
<p>Some content here...</p>
</div>
<div class="handbook" id="idTab2">
<p>Some content here...</p>
</div>
</div>
我想要实现的是两个链接,一个用于#idTab1,第二个用于#idTab2。我在下页脚中创建了以下内容...
<div class="subfooter">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><a href="<?php echo url('/content/legal#idTab1');?>">Terms of Use</a> | <a href="<?php echo url('/content/legal#idTab2');?>">Privacy Policy</a><br/>
<small><?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Page generated in %.3f seconds.', $totaltime);
?></small></td>
</tr>
</table>
</div>
上面的链接确实有效,页面打开,但 legal#idTab2 链接到第一个选项卡。我很感激你的任何提示或帮助。
干杯。