2013-04-23 52 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 
     }); 
    });