status:{
allowGetChapter: true,
neid:‘‘
},
scrollLoad:function(e){
novelJS.read.status.neid=e;
$(window).scroll(function(){
let doheight=$(document).height();//文档的高度
let winheight=$(window).height();//当前页面的高度
let winscrhei=$(window).scrollTop();//滚动的高度
if(novelJS.read.status.allowGetChapter){
if((doheight-winheight)-winscrhei<=35&&winscrhei>0){
novelJS.read.status.allowGetChapter=false;
if(typeof(novelJS.read.status.neid)==‘number‘){
novelJS.read.loading();
$(‘.read-content .read-contentl .readlistnum .readolnum ol li span‘).map(function(){
if($(this).attr(‘data‘)==novelJS.read.status.neid){
$(this).parent().css({‘color‘:‘#369f9a‘}).siblings().css({‘color‘:‘#b0afae‘});
setTimeout(function(){
$(".read-content .read-contentr .read-contentr-HC .loading").remove();
$.ajax({
type:‘get‘,
url:"/chapter/"+novelJS.read.status.neid,
dataType:‘json‘,
success:function(res){
let str=`<div class="read-contentrchapter-na">`+"Charpter"+res.data.chapter_number+`</div>`+
`<div class="read-contentrchapter-nafon">`+res.data.chapter_title+`</div>`+
`<div class="read-contentr-transla">`+"Translator:"+res.data.translator+`</div>`+
`<div class="read-contentr-HC" data="{{ $chapter->id}}">`+ res.data.chapter_content+`</div>`
$(".read-content .read-contentr").append(str);
if($(‘.read-contentr-botbac .botbackcirb‘).hasClass(‘botbackcirbor‘)){
$(‘.read-contentrchapter-nafon‘).addClass(‘read-contentrchapter-nafonb‘);
$(‘.read-contentr-HC‘).addClass(‘read-contentr-HCb‘);
}
novelJS.common.changeURL(res.data.path,res.data.chapter_title+‘-NOVELBR‘);
novelJS.read.status.neid=res.data.nextChapterId;
novelJS.read.status.allowGetChapter=true;
},
error:function (res) {
}
});
},1000)
}
})
}
}
}
});
}