I go through the code and I just do not understand what is the offset function returning:
$(document).ready(function() {
$('#goto-show-form').click(function() {
$('html, body').animate({scrollTop: $("#show-form").offset().top}, '500');
$('#first-field').focus();
return false;
});
});
Please explain the offset function and how it works and what it returns. So what is it returning in:
$("#show-form").offset().top
What is the difference between a div top and offset top?
jQuery’s offset() function returns the left and top of the element with respect to the document left and top.