- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Infinite Scroll 中的新 Tumblr like 按钮(允许您的主题在主页上的单个 Tumblr 帖子上使用类似按钮)它们适用于第一个“页面”的前 15 个帖子,但一旦它加载另一个页面喜欢按钮停止工作。这些是 Tumblr 在文档页面上给出的说明:
Function: Tumblr.LikeButton.get_status_by_page(n)
Description: Call this function after requesting a new page of Posts. Takes the page number that was just loaded as an integer.Function: Tumblr.LikeButton.get_status_by_post_ids([n,n,n])
Description: Request Like status for individual posts. Takes an array of post IDs.
// MASONRY
var $container = $('#content');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector: '.entry',
columnWidth: 220
});
});
// INFINITE SCROLL
$container.infinitescroll({
navSelector : '#pagination',
nextSelector : '#pagination li a.pagination_nextlink',
itemSelector : '.entry',
loading: {
img: 'http://static.tumblr.com/glziqhp/K37m9yaub/257__1_.gif'
}
},
function( newElements ) {
var $newElems = $( newElements ).css({
opacity: 0
});
$newElems.imagesLoaded(function(){
$newElems.animate({
opacity: 1
});
$container.masonry(
'appended', $newElems, true
);
});
});
最佳答案
首先,您需要为每个帖子添加一个唯一的帖子 ID:
<div class="entry masonry-brick" id="{PostID}">...</div>
function( newElements ) {
var $newElems = $( newElements ).css({
opacity: 0
});
// Create Array of $newElems IDs
var $newElemsIDs = $newElems.map(function () {
return this.id;
}).get();
$newElems.imagesLoaded(function(){
$newElems.animate({
opacity: 1
});
$container.masonry(
'appended', $newElems, true
);
// Let's just see what we have, remove console.log() if working
console.log($newElems, $newElemsIDs);
Tumblr.LikeButton.get_status_by_post_ids($newElemsIDs);
});
});
关于scroll - 使用 Tumblr Like Button 和无限滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16390193/
我遇到过这个 html: 上面的html和这个有什么区别: 最佳答案 来自MDN page on the tag : 对于 type 的属性标签,可能的值是: 提交:按钮将表单数据提交给服务器
Button button= (Button) findViewbyID(R.id.button); 和 Button button = new Button(this); 有什么区别? 最佳答案 有
我是一名优秀的程序员,十分优秀!