【 以下文字转载自 Java 讨论区 】
发信人: zli07 (Anonymous), 信区: Java
标 题: 闲来无事发个我的宏
发信站: 水木社区 (Mon Jun 27 14:18:21 2011), 站内
javascript:(function(trig,interv){%20if(window.$M_Scroll){%20clearInterval($M_Scroll);%20$M_Scroll=0;%20return;%20}%20var%20d=document;var%20max=0;%20if(frames.length){%20for(var%20n=0;n<frames.length;n++){%20var%20fn=frames[n].frameElement;%20var%20siz=fn.clientWidth*fn.clientHeight;%20if(siz>max){%20max=siz;%20d=fn.contentDocument;%20}%20}%20}%20var%20e=d.doctype?d.documentElement:d.body;%20$M_Scroll=setInterval(sched,trig);%20function%20sched(){%20var%20l=e.scrollTop=e.scrollTop+interv;%20if(e.scrollTop!=l){%20clearInterval($M_Scroll);%20$M_Scroll=0;%20}%20}%20return;%20})(10,1)
用来滚屏的宏,做成书签放在浏览器工具栏上,点一下就能自动滚屏,再点一下就能停止。最后两个参数10 和 1 分别是滚屏间隔(毫秒)和每次滚动像素数。
--
FROM 59.66.186.*