这是我尝试过的,即使我尝试过也无法正常工作
$(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('refresh') 需要帮助!