更改

跳到导航 跳到搜索
添加862字节 、​ 2022年10月16日 (日) 01:37
无编辑摘要
第41行: 第41行:  
     $( ".WidgetStyle" ).remove();
 
     $( ".WidgetStyle" ).remove();
 
   }
 
   }
 +
});
 +
 +
/* 回到顶部 */
 +
$(function() {
 +
    var txt = '<i class="fa-angle-double-up fas"></i>',
 +
        btn = $('<div/>', {
 +
            'html': txt,
 +
            'attr': {
 +
                'title': '回到顶部',
 +
                'class': 'backToTop'
 +
            },
 +
            'css': {
 +
                'user-select': 'none'
 +
            },
 +
            'on': {
 +
                'click': function() {
 +
                    $("html, body").animate({
 +
                        scrollTop: 0
 +
                    }, 120);
 +
                }
 +
            }
 +
        }).appendTo(document.body);
 +
  var fadeOutTimeout;
 +
  $(window).on('scroll', function() {
 +
    if ( $(document).scrollTop() == 0 ) {
 +
      btn.fadeOut();
 +
    } else {
 +
      clearTimeout(fadeOutTimeout);
 +
      btn.fadeIn();
 +
      fadeOutTimeout = setTimeout( function(){ btn.fadeOut(); }, 2333 );
 +
    }
 +
  }).scroll();
 
});
 
});

导航菜单