我有以下问题:window.location.hash - 停止重装铬
$('.gotoservices').click(function(){
$('html,body').scrollTo($("#services"),1000);
window.location.hash = "services";
return false;
});
此代码的工作,但由于某些原因,scrollTo
之前的页面闪烁。
如果我删除window.location.hash
行return false;
工作,并且页面不闪烁/闪烁。
我曾尝试e.preventDefault
- 不工作
我努力寻找周围的任何工作。
干杯
我想你只需要其中的一个。设置'window.location.hash'也会滚动到该位置。 – Ryan
@minitech在Chrome的情况下不正确 – Pierre
@Pierre:呃... [不,它不是?](http://jsfiddle.net/minitech/TBAce/) – Ryan