[jquery]判斷捲到網頁的底部/移除array內某個值-scrollTop-at-bottom-and-remove-value-from-array
原文參考 http://stackoverflow.com/a/17078097/4985012
原文參考 http://stackoverflow.com/questions/3596089/how-to-remove-specifc-value-from-array-using-jquery
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
// ajax call get data from server and append to the div
}
});
原文參考 http://stackoverflow.com/questions/3596089/how-to-remove-specifc-value-from-array-using-jquery
var y = [1, 2, 2, 3, 2]
var removeItem = 2;
y = jQuery.grep(y, function(value) {
return value != removeItem;
});
Result:
[1, 3]
留言
張貼留言