简体   繁体   English

IE8 在 ajax onload 事件上向下滚动

[英]IE8 scrolls down on ajax onload event

I have trouble with this page for example: http://www.last.cz/exotika.html .我对这个页面有问题,例如: http://www.last.cz/exotika.html If you open it in FF or chrome, you start at the top of page.如果您在 FF 或 chrome 中打开它,您将从页面顶部开始。 But when you try in IE8, it loads scrolled past the header.但是,当您在 IE8 中尝试时,它会滚动加载超出 header。 Compatibility mode does not help.兼容模式无济于事。 I think the filter details that get filled by onload function cause it.我认为由 onload function 填充的过滤器细节会导致它。 Does anyone who ran into the same problem know how to fix it?遇到同样问题的人知道如何解决吗? A css hack would work I guess.我猜 css hack 会起作用。

Thanks for suggestions.感谢您的建议。 Mike麦克风

This will be executed onload(placed in core.js):这将在加载时执行(放置在 core.js 中):

$('#item0').focus()

That's what happens, the element #item0 gets the focus and the page scrolls down to fully show the element(it will scroll until the bottom-border of the first "hotel-box"--thats what #item0 actually is-- occurs inside the viewport).这就是发生的事情,元素#item0 获得焦点,页面向下滚动以完全显示元素(它将滚动到第一个“酒店框”的底部边框 - 这就是 #item0 实际上是 - 出现在里面视口)。

Other browsers may ignore the instruction because the element is a <div/> and can not be focused.其他浏览器可能会忽略该指令,因为该元素是<div/>并且无法获得焦点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM