滚动条在 javascript 中不工作
Scroller is not working in javascript
我是运行一个javascript在图像放大时向下滚动但滚动器不起作用
这是脚本
$(function(){
// Add a custom filter to recognize images from lorempixel (that don't end with ".jpg" or something similar)
$.tosrus.defaults.media.image = {
filterAnchors: function( $anchor ) {
return $anchor.attr( 'href' ).indexOf( 'cdn.shopify.com' ) > -1;
}
};
$('#example-2 a').tosrus({
pagination : {
add : true
},
caption : {
add : true
},
slides : {
scale : 'fill'
}
});
});
试试这个
$('#event-list').scroll(function() {
var curScroll = $(this)[0].scrollTop,
maxScroll = $(this)[0].scrollHeight - $(this).height();
console.log(curScroll, ' :: ', maxScroll);
if ((curScroll >= maxScroll - 200) && !loading) {
loading = true;
$(this)[0].scrollTop = curScroll;
$('.loading').fadeIn('fast');
if (page <= $('.page').length) {
loadMore();
}
}
});
我是运行一个javascript在图像放大时向下滚动但滚动器不起作用 这是脚本
$(function(){
// Add a custom filter to recognize images from lorempixel (that don't end with ".jpg" or something similar)
$.tosrus.defaults.media.image = {
filterAnchors: function( $anchor ) {
return $anchor.attr( 'href' ).indexOf( 'cdn.shopify.com' ) > -1;
}
};
$('#example-2 a').tosrus({
pagination : {
add : true
},
caption : {
add : true
},
slides : {
scale : 'fill'
}
});
});
试试这个
$('#event-list').scroll(function() {
var curScroll = $(this)[0].scrollTop,
maxScroll = $(this)[0].scrollHeight - $(this).height();
console.log(curScroll, ' :: ', maxScroll);
if ((curScroll >= maxScroll - 200) && !loading) {
loading = true;
$(this)[0].scrollTop = curScroll;
$('.loading').fadeIn('fast');
if (page <= $('.page').length) {
loadMore();
}
}
});