我无法获得循环对齐jquery Isotope模块的经典砌体样式布局。jQuery同位素不应用布局。继承问题?
所有浏览器都在控制台中加载脚本,但属性看起来根本不起作用。 .item class div元素的对齐方式全部位于左侧并水平堆叠。
Wordpress是否有某种继承阻止它的工作?我试图在默认的TwentyTwelve主题的WordPress的没有其他插件,但它是在positin:固定; div将其包装到页面的较低50%。
<script type="text/javascript" src="http://<?php echo $_SERVER[HTTP_HOST]; ?>js/jquery.isotope.js">
$(document).ready(function(){
$('#container').isotope({
$container.isotope({
itemSelector:'.item'
});
masonry: {
columnWidth: 20
};
});
</script>
其次是调用HTML:
<div id="container" >
<div class="item">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (has_post_thumbnail()) {
the_post_thumbnail('thumbnail');
}?>
<h2><a href="<?php the_permalink() ?>" rel="<?php the_ID(); ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php endwhile; endif; ?>
</div>
</div>
有了这些应用CSS属性,这我想应该不是问题...
#container {
position:relative;
}
.item {
width:50px;
height:auto;
border:1px;
}
实况例如,它现在在这里:justingaskin.com
'$ container'定义在哪里?我也从来没有使用过'同位素',但它看起来好像你正在调用它两次。 – 2013-05-03 16:11:55
可能是。我仍然需要处理后端开发JS的问题。现场示例有帮助吗? – canacast 2013-05-03 16:49:49
一个生动的例子会有所帮助。 – 2013-05-03 16:57:53