Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadMore那个回调就不去了,之前可以,现在就是进不去,不知道为什么。。 #11

Open
blankul opened this issue Sep 6, 2017 · 1 comment

Comments

@blankul
Copy link

blankul commented Sep 6, 2017

javascript

new Scrollload({
	  container: $('.commentMain')[0],
	  content: $('.contentWrap')[0],
	  isInitLock: true,
	  loadMore: function(sl) {
	    $.ajax({
	    	url:"/news/newsMoreComments",
	    	data: {
	    		newsId: newsId,
	    		start: start += 10,
	    		pageSize: pageSize 
	    	},
	    	success: function(res){
					var data = res.data
					if (!data) {
          	// 没有数据的时候需要调用noMoreData
            sl.noMoreData()
            return
        	}
					$(sl.contentDom).append(template(data))
	    		sl.unLock()
	    	},  
	    	error: function(){
	    		sl.throwException()
	    	} 
			})
	  }
	})
  • 如果isInitLock: false, 初始化的时候可以进入loadMore 一次,之后就进不去了。。
@blankul
Copy link
Author

blankul commented Sep 6, 2017

还有就是对 container 还有content 的style有什么要求吗?

loadMore触发的契机是什么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant