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>
    感谢来访,共同学习!
  • 相关阅读:
    EOF:getchar()函数返回的一个特殊值
    elementUI的el-select使用filterable无效
    element table单元格相关的样式
    关于前端权限的一点想法--续
    IE浏览器与PDF文件
    vue form表单数据无法修改
    computed数据变动,table加载不全
    vue插件开发(本地使用)
    element table
    对象删除(消耗时间验证)
  • 原文地址:https://www.cnblogs.com/dingxiaowei/p/3058742.html
Copyright © 2011-2022 走看看