点击后,重新调焦到标签不起作用。有什么建议?我当然在使用jQuery。
基本上,我想重新聚焦到此选项卡,并在重新聚焦时同时打开选项卡。
我的代码是:here in jsfiddle
JS:
$(document).ready(function(){
//Animates Scrolling
function scrollToAnchor(aid){
var divTag = $("div[name='"+ aid +"']");
$('html,body').animate({scrollTop: divTag.offset().top},'slow');
}
$("#ReadDescription").click(function() {
scrollToAnchor('longdescreadmore');
});
});
HTML,我正在努力关注:
<div class="tab-pane" id="readmore">
<div name="longdescreadmore" id="longdescreadmore">[[DMI:Property name='LongDescription']][[/DMI:Property]]</div>
</div>
HTML,标题页:
<li class="readmore"><a href="#readmore">Read More</a></li>
HTML,点击操作正在进行中:
<h2 id="ReadDescription" class="ReadDescription">Read More</h2>