【发布时间】:2013-01-17 16:31:09
【问题描述】:
这可能有点难以解释,但我会尽力而为。我有一个带有两个选项卡、完整描述和视频的产品页面。这些是使用 jQuery UI 选项卡完成的。
在页面的这一部分上方,我有一张带有缩略图的产品图片......但我希望其中一个缩略图成为观看视频的链接(当然包含在视频标签中)。
If I load the page as site.com/product#video it does load up the correct tab...but when the tab is not active, and I use a link outside of the #tab div, (ex: Video ),它什么也没做。
如果标签不包含在#tab div 中,我如何获得打开标签的链接?
代码
这段代码在标签之外,需要打开#video标签
<a href="#video">Open Video Tab</a>
标签代码
<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="product-tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover"><a href="#description">Full Description</a></li>
<li class="ui-state-default ui-corner-top"><a href="#video">Video</a></li>
</ul>
<div class="product-collateral">
<div class="box-collateral box-description">
<div id="description" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
Content
</div>
<div id="video" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide">
<h2 class="video">Video Content</h2>
</div>
</div>
</div>
</div>
【问题讨论】:
-
你有什么代码可以分享给我们吗?
-
在问题中添加了示例代码。
-
您将不得不向我们提供更多信息。现在看起来你需要用一些 jquery 来解决这个问题。如果它是这样工作的,一个快速修复可能会使 href absolute = hfef="site.com/product#video" 。否则,您将需要 jquery 来查找 hashchange。发送一些链接到喜欢的屏幕截图或 jfiddle?
-
亲爱的,如果你能解决它,请也看看这个。 stackoverflow.com/questions/20090656/…