2013-04-23 54 views
0

当垂直塌陷李项目我做这个网站:使用书签

http://frankkluytmans.nl/testsite/

,并制作一份列表视图中,我使用wookmark jQuery插件,使列表项正确对准垂直。现在列表项目正在垂直折叠(请参阅链接)。我能做些什么来解决这个问题?

CSS:

#content ol { 
    position: relative; 
    display: block; 
    margin-left: -2%; 

    list-style-type: none; 
} 

#content ol li { 
    display: block; 
    width: 18%; 
    height: auto; 
    margin-left: 2%; 
    margin-bottom: 20px; 
    padding: 3px; 

    background: white; 
    float: left;  
} 

#content ol li img { 
    width: 100%; 
    border: none; 
} 

JS:

$('#content ol li').wookmark({ 
    container: $('#content ol'), 
    offset: 20 
}); 

回答

0

我能制定出我自己的解决方案。结果webkit浏览器需要首先加载图像才能够计算列表元素的正确高度。

我调整我的JS这样:

$("img").load(function() { 
     $('#content ol li').wookmark({ 
      container: $('#content ol'), 
      offset: 15 
     }); 
    });