zoukankan      html  css  js  c++  java
  • div的移动特效

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
        <style type="text/css">
            #d1
            {
                100px;
                height:100px;
                position:absolute;
                background-color:Red;
                left:10px;
                top:50px;
                <!--filter:alpha(opacity=0);-->
                }
        </style>
        <script type="text/javascript">
            $(function () {
                $("#btn").click(function () {
                    //animate里面的参数是按照先静后动来执行的,所以有一个参数是函数参数,先执行前面的后执行动画里面的
                    $("#d1").animate({ "left": 300, "top": 300, "opacity": 100 }, 1000).animate({ "width": 300, "height": 300, "opacity": 10 }, 1000, function () {
                        $(this).css("background-color", "blue");
                    });
                })
                //左移
                $("#btn1").click(function () {
                    $("#d1").animate({ "left": "-=80" },1000);


                })
                //右移
                $("#btn2").click(function () {
                    $("#d1").animate({ "left": "+=80" }, 1000);


                })
            })
        </script>
    </head>
    <body>
        <input id="btn" type="button" value="动画" />
        <input id="btn1" type="button" value="向左"/>
        <input id="btn2" type="button" value="向右"/>
        <div id="d1">
        </div>
        <audio src="铃声 - 听海.mp3" autoplay="autoplay"></audio><br />
        <video src="说好的及格呢.mp4" width="100px" height="100px" controls="controls" autoplay="autoplay"></video>
    </body>
    </html>
    感谢来访,共同学习!
  • 相关阅读:
    pythonldap 简单试用
    shell 将文件名读入数组
    pytest命令行传入自定义的参数到测试文件中
    Python实现在不同Linux主机之间拷贝文件
    使用minio搭建私有化对象存储服务
    CPU/GPU/NPU
    pytest 内置和自定义marker
    安装SQLite3引发的库问题
    C标准库——程序员等级
    这样还弄不死指针?
  • 原文地址:https://www.cnblogs.com/dingxiaowei/p/3058742.html
Copyright © 2011-2022 走看看