js的一些使用

1、js定位div位置:(1)window.location.hash="标签名"

         (2)javascript:document.getElementById('标签名').scrollIntoView()

<div>
  <a onclick="window.location.hash='#aa_1'">a</a>
</div>

<div style="height: 500px;" id="aa_1">
  <a href="http://www.baidu.com" title="aesfwaef;ah">bbbb</a><br />
  <br />
</div>

posted @ 2016-08-09 14:58  开心的饭饭  阅读(102)  评论(0编辑  收藏  举报