2

我一直在与砌体作斗争。似乎它正在尝试做它的工作,但它没有正确对齐。我已经尝试修复它几个小时了。我在这里搜索,发现有同样问题的人,但解决方案对我不起作用。这是所有代码:

<div id="container">
    <?php while (next_news()): ?>
<div class="newsitem">
<span class="newstitle"><?php printNewsTitleLink(); ?></span>
<span class="newsdate"><?php printNewsDate(); ?></span>
<span class="newscontent"><?php printNewsContent(); ?></span>
</div>    
    <?php endwhile; ?>
</div>

CSS 代码:

div.newsitem {
    width:215px;
    text-align:justify;
    margin:5px;
    padding:15px;
    float: left;
    font-size:12px;
    background-color:#FFF;
}

#container {
    display:inline-block;
}

这是脚本,我确实尝试为列指定宽度或更改 Gutterwidth,但没有任何效果:

我的脚本:-

<script>
$(function(){
$('#container').masonry({
itemSelector: '.newsitem'
});
});
</script>

在这里包含的文件使其全部工作:

<script src="<?php echo $_zp_themeroot; ?>/js/jquery-1.7.2.min.js"></script>
<script src="<?php echo $_zp_themeroot; ?>/js/jquery.masonry.min.js"></script>

它应该在哪里工作:http ://dagloos.com/lust/index.php?p=news 请帮助我,我将不胜感激。我正要为此拔头发。

4

3 回答 3

1

我弄清楚了问题所在!

<script src="<?php echo $_zp_themeroot; ?>/js/jquery.masonry.min.js"></script>

只需要放在精美的盒子脚本之后。

于 2012-07-23T13:02:41.323 回答
0

首先,尝试放置

  $(function(){$('#container').masonry({ itemSelector: '.newsitem' }); });

在 - 的里面

$(document).ready(function() {

功能,我想它应该可以工作。


在黑暗中拍摄,但尝试更换:

div.newsitem {}

.newsitem{}

边注:

<script type="text/javascript" src="/lust/themes/bottomline/js/jquery.fancybox-buttons.js"></script>

目前导致404。

于 2012-07-23T12:47:27.777 回答
0

在控制台中,它清楚地表明它无法加载砖石。

TypeError: Object [object Object] 没有方法'masonry'

于 2012-07-23T13:06:00.753 回答