jquery页面滚动到指定位置

七 28 2010 Published by zdy under 编程技巧

兼容所有浏览器

<div id="_mcePaste">var body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');</div>
<div id="_mcePaste">body.animate({scrollTop: $('#id').offset().top}, 500);</div>

其中$(‘#id’)为要跳转到的位置元素

Related posts:

  1. 关于javascript的一点注意事项,IE和FIREFOX 脚本的一些区别
  2. javascript获取网页中鼠标选中的文字或选中指定文字
  3. javascript在窗口见通信
  4. EasyUI如期而至,jQuery替代Extjs

No responses yet

发表评论

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: