Reputation: 2557
I try output something when document scroll top will be equal to offset of some my blocks. But I didn get any results. Here is code:
$(document).ready(function () {
if ($(document).scrollTop() === 3385) {
console.log($('#services').offset());
}
});
What I am doing wrong?
Upvotes: 0
Views: 300
Reputation: 4233
Try this:
$(document).ready(function () {
if ($('html').offset().top === 3385) {
console.log($('#services').offset());
}
});
Upvotes: 1