zoukankan      html  css  js  c++  java
  • 三维聚源

    1.有如下代码,请说出程序的运行结果

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title></title>
        </head>
        <body>
            <script type="text/javascript">
                var a=0;//第一步:a=0;
                setTimeout(
                    function(){
                        alert(++a);//第三步:a=21;
                        a=100;
                    },100
                );
                a=20;//第二步:a=20;
            </script>
        </body>
    </html>

    弹出21

    2.略

    3.有如下代码,请说出两块div的尺寸和Hello word的颜色。

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title></title>
            <style type="text/css">
            #cotent{width: 400px;}
                 div{width: 100%;}
                .box>div{width: 200px;}
                .block{width:300px;}
                
                .red{color: red;}
                .blue{color:blue;}
            </style>
        </head>
        <body>
            
            <div class="box">
                <div id="cotent" class="blue block red">
                    hello
                </div>
            </div>
        </body>
    </html>

    box宽100%

    cotent宽400px

    Hello word为蓝色

    具体原因为:http://www.cnblogs.com/flyings/p/5401410.html

    4.实现轮播图,分别用js和css3

    js实现

    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript" src="js/jquery-2.1.4.min.js" ></script>
        <style type="text/css">
            #box{width: 400px;   position:relative;  overflow: hidden; background-color: red; height: 200px; }
            #picShow{width: 1200px; height: 200px; background-color: #fff; position: absolute; }
            #picShow img{width:400px; float:left; }
        </style>
    </head>
    <body>
        <div id="box">
            <div id="picShow">
                <img alt="" src="images/1.jpg" />
                <img alt="" src="images/2.jpg" />
                <img alt="" src="images/3.jpg" />
            </div>
         </div>
            <script type="text/javascript">
                function move(){
                    $("#picShow").animate({marginLeft:-400},"slow",function()
                    {
                        $("#picShow img:last").after($("#picShow img:first"))
                        $("#picShow").css({marginLeft:0})
                    })
                }
                setInterval(move,2000)
            </script>
    </body>
    </html>

     css3实现

    暂无
  • 相关阅读:
    Docker
    mysql+centos7+主从复制
    scrapy-redis使用以及剖析
    Python数据库连接池DBUtils
    MySQL 之【视图】【触发器】【存储过程】【函数】【事物】【数据库锁】【数据库备份】
    揭开Socket编程的面纱
    Linux环境下安装python3.6
    Python操作 RabbitMQ、Redis、Memcache、SQLAlchemy
    WebSocket源码剖析
    1.1 MySQL用户管理及SQL语句详解
  • 原文地址:https://www.cnblogs.com/dshvv/p/5401365.html
Copyright © 2011-2022 走看看