2018-01-28 23:22:43 +11:00
|
|
|
//スクロールで続きを読む
|
|
|
|
function scrollevent() {
|
2018-02-05 01:56:31 +11:00
|
|
|
$(".tl-box").scroll(function() {
|
2018-01-28 23:22:43 +11:00
|
|
|
scrollck();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
scrollevent();
|
|
|
|
|
|
|
|
function scrollck() {
|
2018-02-05 01:56:31 +11:00
|
|
|
$(".tl-box").each(function(i, elem) {
|
2018-01-28 23:22:43 +11:00
|
|
|
var tlid = $(this).attr('tlid');
|
|
|
|
//一番上ならためていた新しいトゥートを表示
|
|
|
|
if ($(this).scrollTop() == 0) {
|
|
|
|
var pool = localStorage.getItem("pool_" + tlid);
|
|
|
|
if (pool) {
|
|
|
|
$("#timeline_" + tlid).prepend(pool);
|
|
|
|
jQuery("time.timeago").timeago();
|
|
|
|
localStorage.removeItem("pool_" + tlid);
|
|
|
|
}
|
2018-02-13 06:16:46 +11:00
|
|
|
//自動リフレッシュ
|
|
|
|
if( $("#timeline_" + tlid+" .cvo").length > 100 ){
|
|
|
|
for(var i=100;i<$("#timeline_" + tlid +" .cvo").length;i++){
|
|
|
|
$("#timeline_" + tlid +" .cvo").eq(i).remove();
|
|
|
|
}
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
//続きを読むトリガー
|
2018-02-25 18:21:13 +11:00
|
|
|
var scrt = $(this).find(".tl").height() - 1500;
|
2018-01-28 23:22:43 +11:00
|
|
|
var scr = $(this).scrollTop();
|
|
|
|
if (scr > scrt) {
|
|
|
|
moreload('', tlid);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-01-31 03:43:01 +11:00
|
|
|
|
|
|
|
function goTop(id){
|
2018-02-25 02:59:53 +11:00
|
|
|
if ($("#timeline_box_"+id+"_box .tl-box").scrollTop() > 500){
|
|
|
|
$("#timeline_box_"+id+"_box .tl-box").scrollTop(500)
|
|
|
|
}
|
|
|
|
$("#timeline_box_"+id+"_box .tl-box").animate({scrollTop:0});
|
2018-01-31 03:43:01 +11:00
|
|
|
}
|