2
我使用基于mootools的分页工作正常。然而,我想在用户点击一个新页面(从点击分页链接的底部)返回新的一组评论并回滚到容器div的顶部。Mootools返回包含div的顶部?
是否有一个功能可以使用mootools做类似的事情?
这里是需要的代码改变:
var Comments = new Class({
id: 0,
page: 0,
object: null,
name: null,
parentid: 0,
folder: './',
initialize: function(id, object, name, folder){
// Setup
this.id = id;
this.object = object;
this.name = name;
this.folder = folder;
// Get the comments for this page
this.getComments(this.page);
},
cacheDefeat: function() {
var myDate = new Date();
return '&r=' + myDate.getTime();
},
getComments: function(page) {
this.page = page;
var object = this.object;
var req = new Request({
method: 'get',
url: this.folder + 'backend.php',
onSuccess: function(text, xml) {
object.set('html', text);
}
}).send('objid=' + this.name + '&do=read&thumbs=' + $(this.name + "sel").value + '&id=' + this.id + '&page=' + this.page + this.cacheDefeat());
},
});
我找不出正确的方式滚动事件添加到它。