I need to get the offset of a sibling of the current affixed element. Is this possible? I was hoping to use something like:

<!-- language: lang-js -->
$('.affixed').affix({
    offset: {
        top: 150,
        bottom: function() {
            return $(this).siblings('p').offset().top;
        }
    }
});

But this is just a {top:X, bottom:Y} object and not the actual element. I have multiple .affixed elements that I need to affix dynamically.

The bottom and top functions will pass through the original element that initialized the collection.

For multiple elements, you'll have to wrap affix in each from the original collection.

<!-- language: lang-js -->
$('.affixed').each(function() {
    $(this).affix({
        offset: {
            top: 150,
            bottom: function(e) {
                return $(e).siblings('p').offset().top;
            }
        }
    });
});