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);
                                            }
                                        }

    人生如戏,或实力或演技
  • 相关阅读:
    MySQL改动rootpassword的多种方法
    略论并行处理系统的日志设计
    ERROR (UnicodeEncodeError): 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128
    UnicodeEncodeError: 'ascii' codec can't encode character u'u65e0' in position 1: ordinal not in range(128)
    python -m json.tool 中文乱码 Format JSON with python
    CentOS6.6 zookeeper完全集群搭建
    libvirt kvm云主机监控
    glance image-create
    通过上一节部署出来的 Windows instance 有时候会发现操作系统时间总是慢 8 个小时,即使手工调整好时间和时区,下次 instance 重启后又会差 8 个小时
    云监控网址
  • 原文地址:https://www.cnblogs.com/yang0902/p/5698011.html
Copyright © 2011-2022 走看看