百度云跳转到文件

跳转到文件所在位置

  1. // ==UserScript==
  2. // @name 百度云跳转到文件
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.2
  5. // @description 跳转到文件所在位置
  6. // @author kiki
  7. // @match https://pan.baidu.com/disk/home*
  8. // @grant none
  9. // @require https://code.jquery.com/jquery-latest.js
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. $('[data-button-id="b33"]').parent().append("<span class='g-button'><span class='g-button-right' id='jump'>跳转</span></span>");
  15. $('#jump').on("click",function(){
  16. var top = $(".dir-small:last").offset().top;
  17. if(top>600 || top<0){
  18. $(".dir-small").parent().parent().parent().animate({
  19. scrollTop: top-$(".dir-small:first").offset().top+90
  20. }, 500);
  21. }else if(top<600 && top>0){
  22. $(".dir-small").parent().parent().parent().animate({
  23. scrollTop: $(".dir-small:first").offset().top
  24. }, 500);
  25. }
  26. });
  27. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址