Jquery 在砌体网格中对齐tumblr柱
我试图为我的tumblr博客创建一个主题,看起来应该像 菜单栏和侧边栏是可以的,但是我在对齐上面图片中的帖子时遇到了一点问题,但是我的博客中出现了。请帮帮我。我使用代码作为 CSS:Jquery 在砌体网格中对齐tumblr柱,jquery,html,css,tumblr,masonry,Jquery,Html,Css,Tumblr,Masonry,我试图为我的tumblr博客创建一个主题,看起来应该像 菜单栏和侧边栏是可以的,但是我在对齐上面图片中的帖子时遇到了一点问题,但是我的博客中出现了。请帮帮我。我使用代码作为 CSS: #content{ width:900px; top:65px; left: 10px; float: left; position: absolute; } #container{ float:left; background:#000; width: 900px; margin: 0px auto;
#content{
width:900px;
top:65px;
left: 10px;
float: left;
position: absolute;
}
#container{
float:left;
background:#000;
width: 900px;
margin: 0px auto;
left:10px;
}
.entry {
float:left;
width: 350px;
overflow:hidden;
margin: 15px;
padding: 15px;
background: {color:box};
display: inline-block;
position: relative;
z-index:2;
-webkit-border-radius:3px;
-moz-border-radius:3px;
border-radius:3px;
}
.entry img {
display: block;
width:auto;
max-width: 100%;
}
<div id="container">
<div id="content">
<div class="autopagerize_page_element">
{block:Posts}
<div class="entry">
{........Different types of posts........}
</div>
{/block:Posts}
</div></div></div>
<script src="http://static.tumblr.com/82upcij/4Kio3rj0h/masonry.js"> </script>
<script type="text/javascript">
$(window).load(function () {
$('#content').masonry(),
$('.masonryWrap').infinitescroll({
navSelector : '#pagination',
nextSelector : '#pagination a#nextPage',
itemSelector : ".entry, .clear",
bufferPx : 40,
loadingImg : "",
loadingText : "Loading",
},
function() { $('#content').masonry({ appendedContent: $(this) }); }
);
});
</script>
HTML:
#content{
width:900px;
top:65px;
left: 10px;
float: left;
position: absolute;
}
#container{
float:left;
background:#000;
width: 900px;
margin: 0px auto;
left:10px;
}
.entry {
float:left;
width: 350px;
overflow:hidden;
margin: 15px;
padding: 15px;
background: {color:box};
display: inline-block;
position: relative;
z-index:2;
-webkit-border-radius:3px;
-moz-border-radius:3px;
border-radius:3px;
}
.entry img {
display: block;
width:auto;
max-width: 100%;
}
<div id="container">
<div id="content">
<div class="autopagerize_page_element">
{block:Posts}
<div class="entry">
{........Different types of posts........}
</div>
{/block:Posts}
</div></div></div>
<script src="http://static.tumblr.com/82upcij/4Kio3rj0h/masonry.js"> </script>
<script type="text/javascript">
$(window).load(function () {
$('#content').masonry(),
$('.masonryWrap').infinitescroll({
navSelector : '#pagination',
nextSelector : '#pagination a#nextPage',
itemSelector : ".entry, .clear",
bufferPx : 40,
loadingImg : "",
loadingText : "Loading",
},
function() { $('#content').masonry({ appendedContent: $(this) }); }
);
});
</script>
{block:Posts}
{…….不同类型的职位……}
{/block:Posts}
JQUERY:
#content{
width:900px;
top:65px;
left: 10px;
float: left;
position: absolute;
}
#container{
float:left;
background:#000;
width: 900px;
margin: 0px auto;
left:10px;
}
.entry {
float:left;
width: 350px;
overflow:hidden;
margin: 15px;
padding: 15px;
background: {color:box};
display: inline-block;
position: relative;
z-index:2;
-webkit-border-radius:3px;
-moz-border-radius:3px;
border-radius:3px;
}
.entry img {
display: block;
width:auto;
max-width: 100%;
}
<div id="container">
<div id="content">
<div class="autopagerize_page_element">
{block:Posts}
<div class="entry">
{........Different types of posts........}
</div>
{/block:Posts}
</div></div></div>
<script src="http://static.tumblr.com/82upcij/4Kio3rj0h/masonry.js"> </script>
<script type="text/javascript">
$(window).load(function () {
$('#content').masonry(),
$('.masonryWrap').infinitescroll({
navSelector : '#pagination',
nextSelector : '#pagination a#nextPage',
itemSelector : ".entry, .clear",
bufferPx : 40,
loadingImg : "",
loadingText : "Loading",
},
function() { $('#content').masonry({ appendedContent: $(this) }); }
);
});
</script>
$(窗口)。加载(函数(){
$('#content').mashine(),
$('.masonryWrap').infinitescroll({
导航选择器:“#分页”,
下一个选择器:“#分页a#下一页”,
itemSelector:“.entry,.clear”,
缓冲区px:40,
加载img:“”,
loadingText:“正在加载”,
},
function(){$('#content').mashine({appendedContent:$(this)});}
);
});
您没有正确使用砌体。本质上,您正在调用它,但没有向它传递任何参数,因此它不知道该做什么。你也在错误的元素上调用它。您未询问的无限卷轴问题是另一回事,但以下是您希望如何修复该调用:
$(".autopagerize_page_element").masonry({ itemSelector: ".entry" });
哇!它就像一个符咒。非常感谢。非常感谢:)