一个可暂停的飘窗

news/2024/7/7 19:22:16
<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>飘窗三可暂停</title>
    <style type="text/css">
        div#roll {
            width: 200px;
            height: 200px;
            background-color: rgb(224, 113, 113);
            color: #fff;
            position: absolute;
        }
    </style>
</head>

<body>
    <div id="roll">我是飘窗</div>
    <script type="text/javascript">
        var ggRoll = {
            roll: document.getElementById("roll"),
            speed: 10,
            statusX: 1,
            statusY: 1,
            x: 100,
            y: 300,
            winW: document.documentElement.clientWidth - document.getElementById("roll").offsetWidth,
            winH: document.documentElement.clientHeight - document.getElementById("roll").offsetHeight,
            Go: function () {
                this.roll.style.left = this.x + 'px';
                this.roll.style.top = this.y + 'px';

                this.x = this.x + (this.statusX ? -1 : 1)
                if (this.x < 0) {
                    this.statusX = 0
                }
                if (this.x > this.winW) {
                    this.statusX = 1
                }

                this.y = this.y + (this.statusY ? -1 : 1)
                if (this.y < 0) {
                    this.statusY = 0
                }
                if (this.y > this.winH) {
                    this.statusY = 1
                }
            }
        }
        var interval = setInterval("ggRoll.Go()", ggRoll.speed);
        ggRoll.roll.onmouseover = function () {
            clearInterval(interval)
        };
        ggRoll.roll.onmouseout = function () {
            interval = setInterval("ggRoll.Go()", ggRoll.speed)
        };
    </script>
</body>

</html>


http://www.niftyadmin.cn/n/2205352.html

相关文章

php小程序生成二维码

1 <?php2 3 getwxacode();4 5 //生成二维码6 function getwxacode(){7 $url "https://api.weixin.qq.com/wxa/getwxacode?";8 $url . "access_token" . getToken();9 $postdata [ 10 "path"…

uniapp(1)formdata格式转换

Accept: "*/*", "Content-Type": "text/plain; charsetUTF-8",

机房除尘机房常识讲解机房卫士

灰尘可以说是机房的死故&#xff0c;机房的除尘如果不到位&#xff0c;再好的服务器和网络设备都会出现同题。由于目前的服务器和网络设备在运行过程中会产生很多热量&#xff0c;为了将这些热量散发出去通常会采用主动散热的方式排出热量&#xff0c;由于机房的空间狭小&#…

主动调用其他类的成员(普通调用和super方法调用)

要点说明&#xff1a; python的语法中主动调用其他类是一个难点和重点&#xff0c;主要两种方法&#xff0c;下面逐一介绍&#xff1a; 1 &#xff0c; 主动调用其他类的普通方法 class Base(object):def f1(self):print("5个功能") class Foo(object): #注意…

::v-deep

例如vue项目里v-html解析出来的内容含有img标签&#xff0c;且样式改不掉时用这个。::v-deep img {width: 100%;margin: 0 auto;}

SPI驱动icm20608的实验

文章目录一、设备树二、驱动程序三、应用程序四、测试一、设备树 在pinctrl节点中添加&#xff1a; /* spi驱动 icm20608 */pinctrl_ecspi3: icm20608 {fsl,pins <MX6UL_PAD_UART2_TX_DATA__GPIO1_IO20 0x10b0 /* CS */ /* 只是一个普通的GPIO */MX6UL_PAD_UART2_RX_DA…

uniapp picker时间选择器

//第一种 <picker change"bindPickerChange" :value"index" :range"appointList" range- key"centername"><view class"uni-input">{{appointList[index].centername}}</view></picker>bindPickerC…

linux UART(RS232/485)驱动实验

文章目录一、linux下的UART驱动框架1. uart_driver 注册与注销2. uart_port 的添加与移除3. uart_ops 实现二、6u UART驱动分析1. UART 的 的 platform 驱动框架2. uart_driver 初始化3. uart_port 初始化与添加4. imx_pops 结构体变量三、原理图分析四、RS232驱动编写1. UART3…