更改

跳到导航 跳到搜索
添加178字节 、​ 2022年10月16日 (日) 01:35
无编辑摘要
第53行: 第53行:  
     var txt = " ",
 
     var txt = " ",
 
         btn = $('<div/>', {
 
         btn = $('<div/>', {
        "text": "返回顶部",
+
            'text': 返回顶部,
        "attr": {
+
            'attr': {
            "title": "返回顶部",
+
                'title': 返回顶部,
            "class": "backToTop"
+
                'class': 'backToTop'
        },
+
            },
 
             'css': {
 
             'css': {
 
                 'user-select': 'none'
 
                 'user-select': 'none'
第69行: 第69行:  
             }
 
             }
 
         }).appendTo(document.body);
 
         }).appendTo(document.body);
    $(window).on('scroll', function() {
+
  var fadeOutTimeout;
        $(document).scrollTop() > 0 ? btn.fadeIn() : btn.fadeOut();
+
  $(window).on('scroll', function() {
     }).scroll();
+
    if ( $(document).scrollTop() == 0 ) {
 +
      btn.fadeOut();
 +
    } else {
 +
      clearTimeout(fadeOutTimeout);
 +
      btn.fadeIn();
 +
      fadeOutTimeout = setTimeout( function(){ btn.fadeOut(); }, 2333 );  
 +
     }
 +
  }).scroll();
 
});
 
});
  

导航菜单