【发布时间】:2012-05-21 14:13:12
【问题描述】:
在我的网站上:http://www.entendu.info/ 我正在使用来自http://imakewebthings.com/jquery-waypoints/ 的航点插件
如果用户直接滚动到底部,大多数路点都不会被触发,只有第一个和最后一个2个,好像中间的滚动太快而无法执行。 (航点是滚动时加载的社交按钮)
有什么帮助吗? PS : head.ready 只是使用 headjs 加载外部脚本时 document.ready 的替代。
head.ready(function() {
opts = {
offset: '85%',
continuous: 'true',
};
//$('.share-this').on('click', function(e){
$('.share-this').waypoint(function(event, direction) {
if (direction === 'down') {
var contentId = $('.share-this').attr('rel');
var uri = $('.share-this').attr('rev');
$.ajax({
url: 'http://www.entendu.info/share',
type: 'GET',
dataType: 'html',
data: {id:contentId, url:uri},
complete: function(xhr, textStatus) {
},
success: function(data, textStatus, xhr) {
$('#'+contentId).html(data);
},
error: function(xhr, textStatus, errorThrown) {
}
});
}
else {
// do this on the way back up through the waypoint
}
//});
$.waypoints('refresh')
}, opts);
});
【问题讨论】:
-
不是一个真正的答案,但您可以尝试使用存储库主分支上的版本而不是 1.1.6 版本。
标签: jquery scroll jquery-waypoints