17 lines
529 B
JavaScript
17 lines
529 B
JavaScript
function OnScrollBottom(className, callback, type = "2") {
|
|
if (type == 1) {
|
|
$(className).onscroll = function () {
|
|
if (Math.ceil(this.scrollHeight - this.scrollTop) == this.clientHeight) {
|
|
callback()
|
|
}
|
|
};
|
|
} else {
|
|
_(className).forEach((v, i) => {
|
|
v.onscroll = function () {
|
|
if (Math.ceil(this.scrollHeight - this.scrollTop) == this.clientHeight) {
|
|
callback()
|
|
}
|
|
};
|
|
})
|
|
}
|
|
} |