首页 > 其他 > 详细

三维聚源

时间:2016-04-17 17:38:08      阅读:155      评论:0      收藏:0      [点我收藏+]

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实现

暂无

 

三维聚源

原文:http://www.cnblogs.com/flyings/p/5401365.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!