1
以下是我已经尝试,甚至我都试过添加新的DOM元素waypoints不工作在新元素只工作在旧的元素?
$(document).ready(function() {
$('.entry-item').waypoint(function (direction) {
if (direction === "down") {
$(this).children(".sticky-items").css({
"position": "fixed",
"top": "45px",
"right": "0px"
});
} else if (direction === "up") {
$(this).children(".sticky-items").removeAttr("style");
}
}, {
offset: 5
});
window.addmore = function() {
var $newdiv1 = $('<div class="entry-item"><div class="sticky-items">STICK XX</div><div>');
$('#entries').append($newdiv1);
$.waypoints('refresh');
}
});
$ .waypoints(“刷新”)所必需 帮助不工作!
您的演示代码是不工作 –
@AhmedDousa THX!这是更新jsFiddle:http://jsfiddle.net/VxqNa/24/该问题是关于waypoints插件链接被删除 –