For example, to scroll to a certain element on the page (ie here: How to go to a specific element on page?)
$("#fromTHIS").click(function() {
$("html, body").animate({ scrollTop: $("#toTHIS").offset().top }, 500);
return true;
});
I've tried both and they both look that they are doing the job. What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…