停止滚动顶部AJAX请求后 [英] stop scrolling to top after AJAX request

查看:77
本文介绍了停止滚动顶部AJAX请求后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/1601933/how-do-i-stop-a-web-page-from-scrolling-to-the-top-when-a-link-is-clicked-that-t">How我做停止的网页,滚动到触发JavaScript的一个链接被点击顶部?

我的浏览器滚动到顶部AJAX请求后,然后我用

my browser scrolls to top after ajax request then i use

 $('html, body').animate({ scrollTop: $('#loadMore').offset().top }, 2000);

滚动回到我的股利。 有没有一种方法,我从一开始

to scroll back to my div. is there a way i stop it from scrolling to top from the beginning

推荐答案

您应该添加返回false 您的Ajax调用函数的末尾。或您的在线通话结束:

you should add return false to the end of your ajax call function. Or to the end of your inline call:

<a href="#" onclick="someAjaxCall(); return false">Link</a>

这篇关于停止滚动顶部AJAX请求后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆