您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add auto scroll to bottom funtion for jupyter notebook pages.
当前为
// ==UserScript== // @name jupyter notebook auto scroll // @namespace http://tampermonkey.net/ // @version 0.1 // @description Add auto scroll to bottom funtion for jupyter notebook pages. // @author Scruel Tao // @match http*://*/notebook*/* // @grant none // ==/UserScript== (function() { 'use strict'; var scrollDelay = 100; var defalutEnabled = true; var scrollEnableMap = new Map(); var scrollCheckIndex = 1; $(".output_scroll").each(function() { $(this)[0].scrollTop = $(this)[0].scrollHeight; }); function callScrollToBottom() { setTimeout(scrollToBottom, scrollDelay); } function scrollToBottom() { $(".output_scroll").each(function() { if (!$(this).attr('scroll_checkbox_index')){ $(this).attr('scroll_checkbox_index', scrollCheckIndex); var div = document.createElement('div'); var checkbox = document.createElement('input'); checkbox.type = "checkbox"; checkbox.setAttribute('scroll_checkbox_index', scrollCheckIndex); if (defalutEnabled) { checkbox.checked = "checked"; } checkbox.onclick = function(){ scrollEnableMap.set($(this).attr('scroll_checkbox_index'), checkbox.checked); }; div.append("Auto Scroll: "); div.append(checkbox); $(this).parent().before(div); scrollEnableMap.set(scrollCheckIndex++, defalutEnabled); } if (!scrollEnableMap.has($(this).attr('scroll_checkbox_index'))){ scrollEnableMap.set($(this).attr('scroll_checkbox_index'), defalutEnabled); } var flag = scrollEnableMap.get($(this).attr('scroll_checkbox_index')); if (flag){ $(this)[0].scrollTop = $(this)[0].scrollHeight; } }); callScrollToBottom(); } scrollToBottom(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址