Assuming that you are referring to a known anchor / item; if you use jQuery, they have a selector for "Next Sibling"; find the documentation here:
http://api.jquery.com/next-siblings-selector/
I'm just ending; otherwise, I would create a complete selector for you, but if you don't have an answer later today, I'm going to compile it.
Edit
, , , ... ... ... ( , , JS).
Edit
100% ; , . , ; ( ).
var _anchorOffets = {};
$(document).ready(function () {
$("A[id]:not(A[href])").each(function (index, value) {
var $anchor = $(value);
_anchorOffets[$anchor.attr("id")] = $anchor.offset().top;
});
});
function getNextAnchorId() {
var $window = $(window);
var minOffset = $window.scrollTop() + $window.height();
for (var anchor in _anchorOffets) {
if (_anchorOffets[anchor] >= minOffset) {
return anchor;
}
}
return null;
}
, , , -
function getNextAnchorId() {
var result = null;
$("A[id]:not(A[href])").each(function (index, value) {
var $anchor = $(value);
var $window = $(window);
var minOffset = $window.scrollTop() + $window.height();
if($anchor.offset().top >= minOffset) {
result = $anchor.attr("id");
return false;
}
});
return result;
}
. . - / div .., ( , ). , , , , . , , : D