zoukankan      html  css  js  c++  java
  • QQ长图

    QQ长图:
                            window.onload=function(){
                                            var oBox=document.getElementById("box");//盒子
                                            var aImg=oBox.getElementsByTagName('img')[0];//图片
                                            var oUp=document.getElementById("up");//向上按钮
                                            var oDown=document.getElementById("down");//向下按钮
                                            var num=0;         //向上向下移动的步码;
                                            var timer=null;
                                            function up(){
                                                    num-=10;
                                                    if(num<=-(aImg.offsetHeight-oBox.offsetHeight)){
                                                            clearInterval(timer);
                                                            num=-(aImg.offsetHeight-oBox.offsetHeight);}    //防止num小于-468,再次移入a中继续移动;
                                                    aImg.style.top=num+'px'; //通过top值来使img运动
                                                }
                                            function down(){
                                                    num+=10;
                                                    if(num>=0){
                                                            clearInterval(timer);
                                                            num=0;}
                                                    aImg.style.top=num+'px';
                                                }
                                            oUp.onmouseover=function(){           //上面按钮点击向上运动
                                                    clearInterval(timer);               //清空定时器,防止继续移入多开定时器
                                                    timer=setInterval(up,60);
                                            }
                                            oUp.onmouseout=function(){
                                                    clearInterval(timer);
                                            }
                                            
                                            oDown.onmouseover=function(){
                                                clearInterval(timer);
                                                timer=setInterval(down,60);
                                            }
                                            oDown.onmouseout=function(){
                                                clearInterval(timer);
                                            }
                                        }

    人生如戏,或实力或演技
  • 相关阅读:
    notepad++ 编辑器链接地址可点击
    window的cmd窗口运行git
    php update for mac
    sublime打开文件时自动生成并打开.dump文件
    不能设置sublime text 2 为默认编辑器
    sublime text 2 配置文件
    Compass被墙后如何安装安装
    everything搜索工具小技巧
    Ubuntu安装已经下载好的文件包
    Flutter 异步Future与FutureBuilder实用技巧
  • 原文地址:https://www.cnblogs.com/yang0902/p/5698011.html
Copyright © 2011-2022 走看看