开发者

Can I prevent #div anchoring on a page when using idTabs for jquery?

I am using the idTabs plugin for jQuery on my new site. However, when I try to select a specific tab via the url, say http://crnaz.com/a/about/#staff on page load or via tab navigation, the page anchors to the div #staff instead of page top.

Is there a way to keep the page anchored to the top on url change?

Here's the code (or you can view the source of the page http://crnaz.com/a/about/index.php). Thanks in advance for the help! :

<script type="text/javascript"> 

var start = location.hash; start = start?start.substr(1):0; $(".usual").tabs(true,start);

<div class="usual"> 
  <开发者_如何学编程ul>
    <li><a href="#values">Values</a></li> 
    <li><a href="#theology">Theology</a></li> 
    <li><a href="#nazarene">Nazarene</a></li>
    <li><a href="#staff">Staff</a></li>  
    <li><a href="#contact">Contact Us</a></li>
  </ul> 
  <div id="content-wrapper">
      <div id="values" style="display: block; ">Tab Content</div>
      <div id="theology" style="display: block; ">Tab Content</div>
      <div id="nazarene" style="display: block; ">Tab Content</div>
      <div id="staff" style="display: block; ">Tab Content</div>
      <div id="contact" style="display: block; ">Tab Content</div>
  </div>


As you are using jQuery, you might try to trigger

$("html").scrollTop();

after pageload.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜