mono.js

来自「功能介绍: 一、会员功能模块 1、站内短信发布(设计中) 2、书架收藏夹」· JavaScript 代码 · 共 31 行

JS
31
字号
      var mousey, currentpos, timer; 
      function currentmousey() {
       mousey = window.event.y;

      //得到鼠标在网页中的Y坐标,请注意 event 的大小写

      }
      function initialize(){ 
      timer = setTimeout("scrollwindow()",mousey/2);
	//document.body.style.cursor="hand";
      //用鼠标在网页中的Y坐标来决定执行scrollwindow()函数的频率,从而动态改变网页的滚动速度

      }
      function stopscroll(){
       clearInterval(timer);
	//document.body.style.cursor="";
      }
      function scrollwindow(){
      currentpos = document.body.scrollTop;
      window.scroll(0,++currentpos); 
      if (currentpos != document.body.scrollTop){
      stopscroll();
      }else{
      initialize();
      }
      }
      document.ondblclick = initialize;
      document.onmousedown = stopscroll;
      document.onmousemove = currentmousey; 

      //当在网页上触了鼠标的移动事件,就运行currentmousey函数

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?