如何设置';easeOutBounce';对于jQuery中的返回顶部按钮?
我需要为网页设置一个如何设置';easeOutBounce';对于jQuery中的返回顶部按钮?,jquery,Jquery,我需要为网页设置一个easeOutBounce返回顶部按钮 我只有的代码。scrollTop: $(document).ready(function() { // Show or hide the sticky footer button $(window).scroll(function() { if ($(this).scrollTop() > 500) { $('.back-to-top').fa
easeOutBounce
返回顶部按钮
我只有的代码。scrollTop
:
$(document).ready(function() {
// Show or hide the sticky footer button
$(window).scroll(function() {
if ($(this).scrollTop() > 500) {
$('.back-to-top').fadeIn(200);
} else {
$('.back-to-top').fadeOut(200);
}
});
// Animate the scroll to top
$('.back-to-top').click(function(event) {
event.preventDefault();
$('html, body').animate({scrollTop: 0}, 400);
});
});
首先是jqueryui特性。您需要为它包含jQuery UI引用。@Shaunak D:如何包含jQuery UI?@tharindu_DG:谢谢您的编辑。首先是jQuery UI功能。您需要为它包含jQuery UI引用。@Shaunak D:如何包含jQuery UI?@tharindu_DG:谢谢您的编辑。