Skip to content

Instantly share code, notes, and snippets.

@tranch
Last active August 29, 2015 13:57
Show Gist options
  • Save tranch/9435334 to your computer and use it in GitHub Desktop.
Save tranch/9435334 to your computer and use it in GitHub Desktop.
豆瓣电影评论显示楼层号脚本
(function($) {
$('#comments').find('.comment-item').each(function(i) {
var page, level, paginator = $('.paginator');
page = paginator.length ? parseInt(paginator.find('.on').text()) : 1;
level = i + 1 + (page - 1) * 30;
$(this).find('.author').append($('<strong>').text(level + '楼'));
});
})(window.jQuery);
(function(a){a("#comments").find(".comment-item").each(function(b){var c,e,d=a(".paginator");c=d.length?parseInt(d.find(".on").text()):1;e=b+1+(c-1)*30;a(this).find(".author").append(a("<strong>").text(e+"楼"));});})(jQuery);
@tranch
Copy link
Author

tranch commented Jul 22, 2014

@shellphon 嗯,那我改下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment