【问题标题】:jQuery masonry plugin - Have trouble getting the divs to stack properly in IE7jQuery masonry 插件 - 无法在 IE7 中正确堆叠 div
【发布时间】:2009-07-27 13:59:04
【问题描述】:
我对 jQuery 的 Masonry 插件有疑问。
如果您查看此链接:http://iloveinternet.org/kunder/omk/ 并向下滚动到顶部带有粉红色线条的棕色字段。你能看到那里的 div 框吗?它们应该使用砖石插件以三排并排堆叠在一起。这在大多数浏览器中都可以正常工作,除了 Windows XP 中的 IE7 和我的 Mac 上的并行。
有人知道我做错了什么吗?是不好的 html 代码还是脚本中的某些内容?
为什么...如果您能检查一下您是否在 IE 中遇到同样的问题,那就太好了。
【问题讨论】:
标签:
javascript
jquery
html
css
internet-explorer-7
【解决方案1】:
您的脚本在 index.php 的第 36 行对我造成了错误,其中 document.location.hash 是一个空字符串。
不确定这是否会解决列问题,但最好先从工作页面开始,然后再尝试调试布局/css 问题。
var destination = $( document.location.hash ).offset().top;
试试这样的:
var $el = $( document.location.hash );
var destination = 0;
if ( $el.length ) {
destination = $el.offset().top;
}
$("html:not(:animated),body:not(:animated)").scrollTop( destination );