您的位置:新葡亰496net > 新葡亰官网 > EasyUI左右布居,CSS实现鼠标放图片上显得铜锈绿

EasyUI左右布居,CSS实现鼠标放图片上显得铜锈绿

发布时间:2019-10-01 01:03编辑:新葡亰官网浏览(144)

    CSS3热身实战——过渡与动画(完毕绚烂下拉,手风琴,无缝滚动)

    2017/08/04 · CSS · 9 评论 · 动画, 过渡

    原来的小讲出处: 守候你   

    jquery实现的私家基本导航菜单,jquery实现导航菜单

    前面为我们介绍了一款jquery和css3实现的很酷的美食指南导航。那是一款由jquery开垦的领航菜单。适合放在门户网址的个人客户宗旨后台。效果和美观都不行不错。大家先一同拜见效果图:

    图片 1

     

    在线预览   源码下载

     

    联合看下落成的代码:

    html代码:

    图片 2 <nav class="animated bounceInDown"> <ul> <li><a href="#profile"> <div class="fa fa-user"> </div> Profile </a></li> <li><a href="#message"> <div class="fa fa-envelope"> </div> Messages <span class="badge right">12</span> </a></li> <li class="sub-menu"><a href="#settings"> <div class="fa fa-gear"> </div> Settings <div class="fa right fa-caret-up"> </div> </a> <ul style="display: block;"> <li><a href="#settings">Account </a></li> <li><a href="#settings">Profile </a></li> <li><a href="#settings">Secruity & Privacy </a></li> <li><a href="#settings">Password </a></li> <li><a href="#settings">Notification </a></li> </ul> </li> <li class="sub-menu"><a href="#message"> <div class="fa fa-question-circle"> </div> Help <div class="fa right fa-caret-down"> </div> </a> <ul style="display: none;"> <li><a href="#settings">FAQ's </a></li> <li><a href="#settings">Submit a Ticket </a></li> <li><a href="#settings">Network Status </a></li> </ul> </li> <li><a href="#message"> <div class="fa fa-sign-out"> </div> Logout </a></li> </ul> </nav> View Code

    css代码:

    图片 3 body { background: #f7f7f7 url("1.jpg") no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; font-family: "Roboto"; font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body::before { content: ''; position: fixed; z-index: -1; top: 0; left: 0; background: #34495e; /* IE Fallback */ background: rgba(52, 73, 94, 0.8); width: 100%; height: 100%; } nav { position: absolute; top: 50%; left: 50%; width: 360px; margin: -78px 0 100px -180px; -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1); box-shadow: 0 0 3px rgba(0, 0, 0, 0.1); } nav ul { list-style: none; margin: 0; padding: 0; } nav ul li { /* Sub Menu */ } nav ul li a { display: block; background: #3498db; padding: 10px 15px; color: #fff; text-decoration: none; -webkit-transition: 0.2s linear; -moz-transition: 0.2s linear; -ms-transition: 0.2s linear; -o-transition: 0.2s linear; transition: 0.2s linear; } nav ul li a:hover { background: #2980b9; } nav ul li a .fa { width: 16px; text-align: center; margin-right: 5px; } nav ul li a .badge { display: inline-block; background: #fff; /* IE Fallback */ background: rgba(255, 255, 255, 0.2); padding: 3px 7px; color: #fff; font-size: 12px; font-weight: 800; } nav ul li ul li a { background: #444; border-left: 4px solid transparent; padding: 10px 20px; } nav ul li ul li a:hover { background: #333; border-left: 4px solid #3498db; } /* Float Right/Left */ .right { float: right; } .left { float: left; } View Code

    js代码:

    图片 4 $('.sub-menu ul').hide(); $(".sub-menu").click(function () { $(this).children("ul").slideToggle("100"); $(this).find(".right").toggleClass("fa-caret-up fa-caret-down"); }); //@ sourceURL=pen.js View Code

    注:本文爱编程原创作品,转发请评释最先的小说地址:

    <!DOCTYPE html>

    CSS完毕鼠标放图片上出示卡其灰边框 文字描述,css边框

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
    <html xmlns=";
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>鼠标悬停时呈现图片边框和文字描述的图纸特效</title>
    <style type="text/css">
    body{margin: 0;padding: 0;font: normal 10px Verdana, Arial, Helvetica, sans-serif;line-height: 1.8em;background: #1d1d1d url(bg.jpg) repeat;}
    a{color:#999;}
    h1{font-family:Georgia, "Times New Roman", Times, serif;text-align: center;font-weight: normal;font-size: 4em;line-height: 1.2em;margin: 0; padding: 20px 0;color:#999;font-size:18px;}
    img{border: none;}
    ul.gnineh{width: 960px;list-style: none;margin: 0 auto; padding: 0;}
    ul.gnineh li{width: 220px;float: left; display: inline;margin: 10px; padding: 0;position: relative;}
    ul.gnineh li:hover{z-index: 99;}
    ul.gnineh li img{position: relative;filter: alpha(opacity=30);opacity: 0.3;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";}
    ul.gnineh li:hover img{z-index: 999;filter: alpha(opacity=100);opacity: 1;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";}
    ul.gnineh li .info{position: absolute;left: -10px; top: -10px;padding: 210px 10px 20px;width: 220px;display: none;background: #fff;font-size: 1.2em;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;}
    ul.gnineh li:hover .info{display: block;}
    ul.gnineh li h2{font-size: 1.2em;font-weight: normal;text-transform: uppercase;margin: 0; padding: 10px 0;}
    ul.gnineh li p{padding: 0; margin: 0; font-size: 0.9em;}
    body{font-size:12px;font-family:'Arial';line-height:25px;}
    #header{background:#000;height:30px;line-height:30px;margin-bottom:20px;}
    #header h2{float:left;margin:0px 10px;}
    #header h2 a{color:#fff;}
    #main{width:950px;margin:0px auto}
    .code{border:#ccc 1px solid;background:#ffffcc;padding:10px;}
    </style>
    </head>
    <body>
    <div>;
    <h1>纯CSS完成的鼠标触及展现边框和描述的图纸特效</h1>
    <ul class="gnineh">
    <li><a href="/"><img src="wall_s3.jpg" alt=""></a><div class="info"><h2>美貌荃银高科</h2><p>新款车里市堪比波音民用飞机公司。</p></div></li>
    <li><a href="/"><img src="wall_s4.jpg" alt=""></a><div class="info"><h2>小编的黄狗</h2><p>很使人迷恋的红毛猩猩</p></div></li>
    <li><a href="/"><img src="wall_s5.jpg" alt=""></a><div class="info"><h2>穿过市区</h2><p>是野外的清凉</p></div></li>
    <li><a href="/"><img src="wall_s6.jpg" alt=""></a><div class="info"><h2>梦之中相爱的人</h2><p>回首一眸万物俱焚</p></div></li>
    </ul>
    </body>
    </html>

    !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "...

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
    <html xmlns=";
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>鼠标悬停时显示图片边框和文字勾勒汇报的图纸特效</title>
    <style type="text/css">
    body{margin: 0;padding: 0;font: normal 10px Verdana, Arial, Helvetica, sans-serif;line-height: 1.8em;background: #1d1d1d url(bg.jpg) repeat;}
    a{color:#999;}
    h1{font-family:Georgia, "Times New Roman", Times, serif;text-align: center;font-weight: normal;font-size: 4em;line-height: 1.2em;margin: 0; padding: 20px 0;color:#999;font-size:18px;}
    img{border: none;}
    ul.gnineh{width: 960px;list-style: none;margin: 0 auto; padding: 0;}
    ul.gnineh li{width: 220px;float: left; display: inline;margin: 10px; padding: 0;position: relative;}
    ul.gnineh li:hover{z-index: 99;}
    ul.gnineh li img{position: relative;filter: alpha(opacity=30);opacity: 0.3;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";}
    ul.gnineh li:hover img{z-index: 999;filter: alpha(opacity=100);opacity: 1;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";}
    ul.gnineh li .info{position: absolute;left: -10px; top: -10px;padding: 210px 10px 20px;width: 220px;display: none;background: #fff;font-size: 1.2em;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;}
    ul.gnineh li:hover .info{display: block;}
    ul.gnineh li h2{font-size: 1.2em;font-weight: normal;text-transform: uppercase;margin: 0; padding: 10px 0;}
    ul.gnineh li p{padding: 0; margin: 0; font-size: 0.9em;}
    body{font-size:12px;font-family:'Arial';line-height:25px;}
    #header{background:#000;height:30px;line-height:30px;margin-bottom:20px;}
    #header h2{float:left;margin:0px 10px;}
    #header h2 a{color:#fff;}
    #main{width:950px;margin:0px auto}
    .code{border:#ccc 1px solid;background:#ffffcc;padding:10px;}
    </style>
    </head>
    <body>
    <div><A href=";</A></div>
    <h1>纯CSS实现的鼠标触及显示边框和描绘陈述的图纸特效</h1>
    <ul class="gnineh">
    <li><a href="/"><img src="wall_s3.jpg" alt=""></a><div class="info"><h2>美貌荃银高科</h2><p>新车的里面市堪比波音民用飞机公司。

    1.前言

    在自身的专辑上写了十几篇作品了,都是与js有关的。前段时间还从未写过有关css3的作品。css3,给本身的痛感正是,轻巧,可是很难玩转自如。明天,就用css3来达成多个特效,希望那多少个例外能让大家受到启迪,利用css3做出更加好,更炫的动画片效果,並且比较那八个特效和JS特效的周旋统一,希望能支援到是我们学到CSS3的有的学问。后天那多个案例能够说是三个预习只怕热身吧,未来也会写关于CSS3更加好的创作仍旧文章,近年来本身也是在编写制定多个css3的动画库!

    jquery实现菜单点击时间难点

    //在拍卖点击张开的时候,能够将事先全数张开的菜系关闭一下。
    $(document).ready(function () {
    $("li.mainlevel").click(function () {
    $("li.mainlevel > ul").hide();
    $(this).find("ul").slideDown(300);
    });
    });  

    <html xmlns=";
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>首页</title>
        <link href="Scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
        <link href="Scripts/easyui/themes/icon.css" rel="stylesheet" />
        <link href="Scripts/easyui/demo/demo.css" rel="stylesheet" />
        <style type="text/css">
            ul {
                margin: 0;
                padding: 0;
            }

    </p></div></li>
    <li><a href="/"><img src="wall_s4.jpg" alt=""></a><div class="info"><h2>笔者的黄狗</h2><p>非常讨人喜欢的黑猩猩</p></div></li>
    <li><a href="/"><img src="wall_s5.jpg" alt=""></a><div class="info"><h2>穿过市区</h2><p>是野外的清凉</p></div></li>
    <li><a href="/"><img src="wall_s6.jpg" alt=""></a><div class="info"><h2>梦里相爱的人</h2><p>回首一眸万物俱焚</p></div></li>
    </ul>
    </body>
    </html>

    2.对接与动画概念理解

    jquery怎调控当前页的导航菜单作用?

    诸如导航的div <div class="nav"><a href="index.html">首页</a><a href="product.html">产品</a><a href="case.html">案例大旨</a></div>

    下面的html内容:
    <div class="main">
    <div class="content">首页的剧情</div>
    <div class="content">产品的从头到尾的经过</div>
    <div class="content">案例核心的源委</div>
    </div>
    至于class=“content”能够是你和谐丰盛的为了方便jQuery获取,未有那些样式类
    <script type="text/javascript">
    $(document).ready(function()
    {
    var tabs = $('.nav > a');
    var cons = $('.main > div.content');

    tabs.first().addClass("now").show(); //私下认可第一个呈现
    cons.first().show().nextAll().hide(); //私下认可第二个呈现,其余遮掩
    tabs.each(function(index){
    $(this).mouseover(function(){
    $(this).addClass("now").siblings().removeClass("now");
    cons.eq(index).show().siblings().hide();
    });
    });

    });
    </script>  

    以前为我们介绍了一款jquery和css3兑现的很酷的美食做法导航。那是一款由jquery开荒的领航菜...

            li {
                list-style: none;
            }

    css3过渡

    化用菜鸟教程的说法,CSS3接入是因素从一种体裁渐渐更动为另一种的职能。要兑现那点,必需明确两项内容:1.钦赐要增加效果的CSS属性。2.点名效果的持续时间。

            .accordion-body li a {
                text-decoration: none;
                color: #000;
                display: block;
                height: 22px;
                line-height: 22px;
            }

    css3动画

    化用新手教程的说教,CSS3动画片是依照@keyframes法则内钦命一个CSS样式和卡通将逐日从目前的样式改动为新的体制。钦定最少这四个CSS3的动画属性绑定向四个采用器:1.分明动画的称号。2.规定动画的时间长度。

            .accordion-body ul li:hover {
                background: #D9D9D9;
            }

    3.交接案例-炫目下拉

            .accordion-body ul li {
                padding: 6px 0 6px 20px;
            }

    图片 5

                .accordion-body ul li span {
                    width: 16px;
                    height: 16px;
                    display: inline-block;
                    margin-right: 8px;
                    position: relative;
                    top: 4px;
    EasyUI左右布居,CSS实现鼠标放图片上显得铜锈绿边框。            }

    3-1规律剖判

    1.先是正是二个导航下拉,正是鼠标放上去现身一个下拉列表
    2.然后发觉,下拉之中,每三个抉择是从分裂的多少个方向出现的
    3.并发的措施是奇数项从侧面进,偶数项从左边进,步向艺术是滑动淡入。

            .index_zt {
                float: right;
                margin-right: 20px;
            }

    3-2落到实处进度

    EasyUI左右布居,CSS实现鼠标放图片上显得铜锈绿边框。1.率先页面的布局,这几个相应我们都了然,菜单无非就是一个ul-li列表,下拉列表便是li上边包车型地铁二个ul-li。

    reset.css(样式复位表和私家常用样式封装)

    JavaScript

    *{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ol,ul{list-style:none}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400}fieldset,img{border:0}textarea{resize:none}a{color:#000;text-decoration:none}.fontsize24,h1{font-size:24px}.fontsize20,h2{font-size:20px}.fontsize18,h3{font-size:18px}.fontsize16,h4{font-size:16px}.fontsize14,h5{font-size:14px}.fontsize12,h6{font-size:12px}.bold{font-weight:700}.fllil li{float:left}.fllir li{float:right}.fl{float:left}.fr{float:right}.radius{border-radius:100%}.positionCenterLeft{left:0;right:0;margin:auto}.positionCenterTop{top:0;bottom:0;margin:auto}.positionCenter{top:0;bottom:0;left:0;right:0;margin:auto}.distable{display:table}.distablecell{display:table-cell;vertical-align:middle}.textels{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.marginCenter{margin:0 auto}.t_l{text-align:left}.t_c{text-align:center}.t_r{text-align:right}.unLine{text-decoration:underline}.fiexd{position:fixed}.absolute{position:absolute}.relative{position:relative}.wrapper{clear:both;overflow:hidden}.o-hidden{overflow:hidden}.hidden{display:none}.block{display:block}.lblock{display:inline-block}.clear{clear:both}.pointer{cursor:pointer}img{border:0;vertical-align:middle}

    1
    *{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ol,ul{list-style:none}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400}fieldset,img{border:0}textarea{resize:none}a{color:#000;text-decoration:none}.fontsize24,h1{font-size:24px}.fontsize20,h2{font-size:20px}.fontsize18,h3{font-size:18px}.fontsize16,h4{font-size:16px}.fontsize14,h5{font-size:14px}.fontsize12,h6{font-size:12px}.bold{font-weight:700}.fllil li{float:left}.fllir li{float:right}.fl{float:left}.fr{float:right}.radius{border-radius:100%}.positionCenterLeft{left:0;right:0;margin:auto}.positionCenterTop{top:0;bottom:0;margin:auto}.positionCenter{top:0;bottom:0;left:0;right:0;margin:auto}.distable{display:table}.distablecell{display:table-cell;vertical-align:middle}.textels{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.marginCenter{margin:0 auto}.t_l{text-align:left}.t_c{text-align:center}.t_r{text-align:right}.unLine{text-decoration:underline}.fiexd{position:fixed}.absolute{position:absolute}.relative{position:relative}.wrapper{clear:both;overflow:hidden}.o-hidden{overflow:hidden}.hidden{display:none}.block{display:block}.lblock{display:inline-block}.clear{clear:both}.pointer{cursor:pointer}img{border:0;vertical-align:middle}

    html代码如下

    JavaScript

    <div class="demo-nav"> <!--.fllil,.clear是在体制重新载入参数表(reset.css)上写好的体裁,.fllil li{fload:left;}.clear{clear:both;}--> <ul class="menu fllil"> <li>HTML5 <ul class="sub-menu"> <li>article</li> <li>section</li> <li>menu</li> <li>nav</li> </ul> </li> <li>CSS3 <ul class="sub-menu"> <li>动画</li> <li>过渡</li> <li>圆形</li> <li>边框</li> </ul> </li> <li>Javascript <ul class="sub-menu"> <li>字符串</li> <li>数组</li> <li>对象</li> <li>布尔</li> </ul> </li> <li>Jquery <ul class="sub-menu"> <li>动画</li> <li>特效</li> <li>AJAX</li> </ul> </li> <li>VUE</li> </ul> <div class="clear"></div> </div>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    <div class="demo-nav">
        <!--.fllil,.clear是在样式重置表(reset.css)上写好的样式,.fllil li{fload:left;}.clear{clear:both;}-->
        <ul class="menu fllil">
            <li>HTML5
                <ul class="sub-menu">
                    <li>article</li>
                    <li>section</li>
                    <li>menu</li>
                    <li>nav</li>
                </ul>
            </li>
            <li>CSS3
                <ul class="sub-menu">
                    <li>动画</li>
                    <li>过渡</li>
                    <li>圆形</li>
                    <li>边框</li>
                </ul>
            </li>
            <li>Javascript
                <ul class="sub-menu">
                    <li>字符串</li>
                    <li>数组</li>
                    <li>对象</li>
                    <li>布尔</li>
                </ul>
            </li>
            <li>Jquery
                <ul class="sub-menu">
                    <li>动画</li>
                    <li>特效</li>
                    <li>AJAX</li>
                </ul>
            </li>
            <li>VUE</li>
        </ul>
        <div class="clear"></div>
    </div>

    css代码如下

    JavaScript

    .demo-nav { width: 500px; margin: 0 auto; } .demo-nav li { line-height: 40px; padding: 0 10px; background: #09f; color: #fff; position: relative; } .demo-nav li ul { position: absolute; left: 0; top: 40px; height: 0; overflow: hidden; } .demo-nav li ul li { float: none; /*连接代码*/ transition: all .3s; background: #f90; opacity: 0; } /*奇数项最初往右侧偏移百分百*/ .demo-nav li ul li:nth-of-type(1n) { transform: translate3d(100%, 0, 0); } /*偶数项初步往左侧偏移百分百*/ .demo-nav li ul li:nth-of-type(2n) { transform: translate3d(-100%, 0, 0); } .demo-nav li:hover ul { overflow: visible; } /*光滑度和互相同一时候张开*/ .demo-nav li:hover ul li { opacity: 1; transform: translate3d(0, 0, 0); }

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
        .demo-nav {
            width: 500px;
            margin: 0 auto;
        }
     
        .demo-nav li {
            line-height: 40px;
            padding: 0 10px;
            background: #09f;
            color: #fff;
            position: relative;
        }
     
        .demo-nav li ul {
            position: absolute;
            left: 0;
            top: 40px;
            height: 0;
            overflow: hidden;
        }
     
        .demo-nav li ul li {
            float: none;
            /*过渡代码*/
            transition: all .3s;
            background: #f90;
            opacity: 0;
        }
        /*奇数项初始往右边偏移100%*/
        .demo-nav li ul li:nth-of-type(1n) {
            transform: translate3d(100%, 0, 0);
        }
        /*偶数项初始往左边偏移100%*/
        .demo-nav li ul li:nth-of-type(2n) {
            transform: translate3d(-100%, 0, 0);
        }
     
        .demo-nav li:hover ul {
            overflow: visible;
        }
        /*透明度和互动同时进行*/
        .demo-nav li:hover ul li {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }

    注意1:在呈现下拉列表的操作上,刚开始隐蔽子菜单ul的体裁,不能够那样写.demo-nav li ul{display:none;}。要如此写.demo-nav li ul{height: 0;overflow:hidden;},鼠标放上父级li的时候,呈现ul不能够这么写.demo-nav li:hover ul{display:block;},要那样写,.demo-nav li:hover ul{overflow: visible;}因为一最早假诺实菜单ul是隐形的,鼠标放到父级li的时候,子菜单ul就展现出来,那样是来看子菜单ul上面li的动画的。

    图片 6

    注意2:子菜单ul要用.demo-nav li ul{height: 0;overflow:hidden;}躲藏,在显示的时候再设置.demo-nav li:hover ul{overflow: visible;}。这一步不可能省,不然会出标题。若是不加,实际上子菜单ul,以及子菜单ul下面的li直接在页面上,假若鼠标移上去子菜单ul,以及子菜单ul下面的li。那么实际上也会触发父级lihover

    图片 7

    图片 8

                .index_zt li {
                    float: left;
                    padding-left: 20px;
                    margin-left: 10px;
                    line-height: 50px;
                    height: 50px;
                    color: #fff;
                    font-size: 12px;
                }

    3-3与JS完结比较

    这几个功效js也是能兑现,达成上也简单,无非正是调用沙漏的难点。不过写的必定比css3多,逻辑也会比css3复杂。
    1.首先,父级li必得求绑定四个鼠标移出和移入事件,也要定义壹脾气格,记录停车计时器(差别的父级li不可能共用三个停车计时器,不然汇合对苦闷,必得每多个父级li下边都要有叁天性质记录放大计时器)。obj.timer=setInterval(function(){},100)
    2.用js实现,实际上也是操作class可能css。所以质量上css3是比js好!
    3.针对这些动画,css3也比js好调整。

                    .index_zt li a {
                        text-decoration: none;
                        color: white;
                    }

    3-4完好无缺代码

    JavaScript

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ec-css导航栏</title> <link rel="stylesheet" href="reset.css"> <style> .demo-nav { width: 500px; margin: 0 auto; } .demo-nav li { line-height: 40px; padding: 0 10px; background: #09f; color: #fff; position: relative; } .demo-nav li ul { position: absolute; left: 0; top: 40px; /*height: 0;*/ /*overflow: hidden;*/ } .demo-nav li ul li { float: none; transition: all .3s; background: #f90; opacity: 0; } .demo-nav li ul li:nth-of-type(1n) { transform: translate3d(100%, 0, 0); } .demo-nav li ul li:nth-of-type(2n) { transform: translate3d(-100%, 0, 0); } .demo-nav li:hover ul { /*overflow: visible;*/ } .demo-nav li:hover ul li { opacity: 1; transform: translate3d(0, 0, 0); } /*最多10级,超过10级的,得写js*/ .demo-nav li ul li:nth-of-type(2) { transition-delay: .1s; } .demo-nav li ul li:nth-of-type(3) { transition-delay: .2s; } .demo-nav li ul li:nth-of-type(4) { transition-delay: .3s; } .demo-nav li ul li:nth-of-type(5) { transition-delay: .4s; } .demo-nav li ul li:nth-of-type(6) { transition-delay: .5s; } .demo-nav li ul li:nth-of-type(7) { transition-delay: .6s; } .demo-nav li ul li:nth-of-type(8) { transition-delay: .7s; } .demo-nav li ul li:nth-of-type(9) { transition-delay: .8s; } .demo-nav li ul li:nth-of-type(10) { transition-delay: .9s; } </style> </head> <body> <div class="demo-nav"> <ul class="menu fllil"> <li>HTML5 <ul class="sub-menu"> <li>article</li> <li>section</li> <li>menu</li> <li>nav</li> </ul> </li> <li>CSS3 <ul class="sub-menu"> <li>动画</li> <li>过渡</li> <li>圆形</li> <li>边框</li> </ul> </li> <li>Javascript <ul class="sub-menu"> <li>字符串</li> <li>数组</li> <li>对象</li> <li>布尔</li> </ul> </li> <li>Jquery <ul class="sub-menu"> <li>动画</li> <li>特效</li> <li>AJAX</li> </ul> </li> <li>VUE</li> </ul> <div class="clear"></div> </div> </body> </html>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>ec-css导航栏</title>
        <link rel="stylesheet" href="reset.css">
        <style>
            .demo-nav {
                width: 500px;
                margin: 0 auto;
            }
     
            .demo-nav li {
                line-height: 40px;
                padding: 0 10px;
                background: #09f;
                color: #fff;
                position: relative;
            }
     
            .demo-nav li ul {
                position: absolute;
                left: 0;
                top: 40px;
                /*height: 0;*/
                /*overflow: hidden;*/
            }
     
            .demo-nav li ul li {
                float: none;
                transition: all .3s;
                background: #f90;
                opacity: 0;
            }
     
            .demo-nav li ul li:nth-of-type(1n) {
                transform: translate3d(100%, 0, 0);
            }
     
            .demo-nav li ul li:nth-of-type(2n) {
                transform: translate3d(-100%, 0, 0);
            }
     
            .demo-nav li:hover ul {
                /*overflow: visible;*/
            }
     
            .demo-nav li:hover ul li {
                opacity: 1;
                transform: translate3d(0, 0, 0);
            }
            /*最多10级,超过10级的,得写js*/
            .demo-nav li ul li:nth-of-type(2) {
                transition-delay: .1s;
            }
     
            .demo-nav li ul li:nth-of-type(3) {
                transition-delay: .2s;
            }
     
            .demo-nav li ul li:nth-of-type(4) {
                transition-delay: .3s;
            }
            .demo-nav li ul li:nth-of-type(5) {
                transition-delay: .4s;
            }
     
            .demo-nav li ul li:nth-of-type(6) {
                transition-delay: .5s;
            }
     
            .demo-nav li ul li:nth-of-type(7) {
                transition-delay: .6s;
            }
            .demo-nav li ul li:nth-of-type(8) {
                transition-delay: .7s;
            }
     
            .demo-nav li ul li:nth-of-type(9) {
                transition-delay: .8s;
            }
     
            .demo-nav li ul li:nth-of-type(10) {
                transition-delay: .9s;
            }
        </style>
    </head>
    <body>
    <div class="demo-nav">
        <ul class="menu fllil">
            <li>HTML5
                <ul class="sub-menu">
                    <li>article</li>
                    <li>section</li>
                    <li>menu</li>
                    <li>nav</li>
                </ul>
            </li>
            <li>CSS3
                <ul class="sub-menu">
                    <li>动画</li>
                    <li>过渡</li>
                    <li>圆形</li>
                    <li>边框</li>
                </ul>
            </li>
            <li>Javascript
                <ul class="sub-menu">
                    <li>字符串</li>
                    <li>数组</li>
                    <li>对象</li>
                    <li>布尔</li>
                </ul>
            </li>
            <li>Jquery
                <ul class="sub-menu">
                    <li>动画</li>
                    <li>特效</li>
                    <li>AJAX</li>
                </ul>
            </li>
            <li>VUE</li>
        </ul>
        <div class="clear"></div>
    </div>
    </body>
    </html>

                .index_zt a:hover {
                    background: #D9D9D9;
                }

    4.连着案例-手风琴

    图片 9

            .icon-cubes {
                background: url(/mhims/img/index/cubes_all.png) no-repeat center center;
            }

    4-1准则剖判

    那些瞧着就轻松,也是四个ul-li,鼠标移入li,li上边的标题颜色,背景观,箭头退换,li下边的div的莫斯科大学改动!

            .icon-online {
                background: url(/mhims/img/index/online.png) no-repeat center left;
            }

    4-2兑现进程

    1.先是,排版ul-li,li上边又有二个标题(这一个用h3),和剧情(div)

    html如下

    JavaScript

    <div class="demo-slide-tab"> <ul> <li> <h3>title 1</h3> <div>content1</div> </li> <li> <h3>title 2</h3> <div>content2conte nt2content2content2content2conten t2content2content2content2content2conte nt2content2content2content2conte nt2content2content2content2 content2content2content 2content2content2content2content2conten t2content2c ontent2content2content2</div> </li> <li> <h3>title 3</h3> <div>content3</div> </li> <li> <h3>title 4</h3> <div>content4.</div> </li> </ul> </div>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    <div class="demo-slide-tab">
        <ul>
            <li>
                <h3>title 1</h3>
                <div>content1</div>
            </li>
            <li>
                <h3>title 2</h3>
                <div>content2conte nt2content2content2content2conten t2content2content2content2content2conte nt2content2content2content2conte nt2content2content2content2 content2content2content 2content2content2content2content2conten t2content2c ontent2content2content2</div>
            </li>
            <li>
                <h3>title 3</h3>
                <div>content3</div>
            </li>
            <li>
                <h3>title 4</h3>
                <div>content4.</div>
            </li>
        </ul>
    </div>

    css代码如下

    JavaScript

    <style> .demo-slide-tab { width: 500px; margin: 0 auto; } .demo-slide-tab ul { width: 100%; margin: 0; padding: 0; } .demo-slide-tab li { list-style: none outside none; display: block; margin: 0; padding: 0; height: 40px; width: 100%; overflow: hidden; background: #f0f0f0; transition: height 0.3s ease-in-out; } .demo-slide-tab h3 { margin: 0; padding: 10px; height: 19px; border-top: 1px solid #f0f0f0; color: #000; background: #ccc; background: linear-gradient(#0099ff, #71d1fd); custor: pointer; position: relative; } .demo-slide-tab h3:before { content: ""; border-width: 5px; border-color: transparent transparent transparent #000; position: absolute; right: 10px; top: 15px; width: 0; height: 0; } .demo-slide-tab div { margin: 0; voerflow: auto; padding: 10px; max-height: 220px; } //鼠标移入li,高度改动 .demo-slide-tab li:hover { height: 280px; } //鼠标移入li,h3背景颜色和字体颜色更换 .demo-slide-tab li:hover h3 { color: #fff; background: #000; background: linear-gradient(#faa305, #fcc054); } //鼠标移入li,箭头方向改动 .demo-slide-tab li:hover h3:before{ border-color: transparent transparent transparent #fff; transform: rotate(90deg); } </style>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    <style>
        .demo-slide-tab {
            width: 500px;
            margin: 0 auto;
        }
     
        .demo-slide-tab ul {
            width: 100%;
            margin: 0;
            padding: 0;
        }
     
        .demo-slide-tab li {
            list-style: none outside none;
            display: block;
            margin: 0;
            padding: 0;
            height: 40px;
            width: 100%;
            overflow: hidden;
            background: #f0f0f0;
            transition: height 0.3s ease-in-out;
        }
     
        .demo-slide-tab h3 {
            margin: 0;
            padding: 10px;
            height: 19px;
            border-top: 1px solid #f0f0f0;
            color: #000;
            background: #ccc;
            background: linear-gradient(#0099ff, #71d1fd);
            custor: pointer;
            position: relative;
        }
     
        .demo-slide-tab h3:before {
            content: "";
            border-width: 5px;
            border-color: transparent transparent transparent #000;
            position: absolute;
            right: 10px;
            top: 15px;
            width: 0;
            height: 0;
        }
     
        .demo-slide-tab div {
            margin: 0;
            voerflow: auto;
            padding: 10px;
            max-height: 220px;
        }
        //鼠标移入li,高度改变
        .demo-slide-tab li:hover {
            height: 280px;
        }
        //鼠标移入li,h3背景颜色和字体颜色改变
        .demo-slide-tab li:hover h3 {
            color: #fff;
            background: #000;
            background: linear-gradient(#faa305, #fcc054);
        }
        //鼠标移入li,箭头方向改变
        .demo-slide-tab li:hover h3:before{
            border-color: transparent transparent transparent #fff;
            transform: rotate(90deg);
        }
    </style>    

    由于那栗子,li里面的div在样式上,设置了padding。所以提出作者的做法是更改li设置overflow: hidden;height:40px;/*高度等于标题的高度,初始就是隐藏div*/。因为假诺鼠标移入li,是操作div的话。
    会有叁个不荒谬!如下栗子!

    局地代码改成如下

    JavaScript

    .demo-slide-tab li { display: block; margin: 0; padding: 0; width: 100%; background: #f0f0f0; } .demo-slide-tab div { margin: 0; height: 0; overflow: hidden; transition: height 0.3s ease-in-out; } .demo-slide-tab li:hover div { padding: 10px; height: 220px; }

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    .demo-slide-tab li {
        display: block;
        margin: 0;
        padding: 0;
        width: 100%;
        background: #f0f0f0;
    }
    .demo-slide-tab div {
        margin: 0;
        height: 0;
        overflow: hidden;
        transition: height 0.3s ease-in-out;
    }
    .demo-slide-tab li:hover div {
        padding: 10px;
        height: 220px;
    }

    图片 10图片 11

    世家看能够见见,鼠标移出的那须臾间,看见div里面包车型客车内容也贴边了!笔者正是为着防止那一个,才通过操作li的莫大来决定div的高度!

            .icon-person-info {
                background: url(/mhims/img/index/person_info.png) no-repeat center left;
            }

    4-3与JS完结相比

    1.以此动画,作者感到即便质量上css3是比js要好一些。究竟js也是调控css只怕class来贯彻!
    2.灵活性的话,那几个将要比js差了,比方div的来得与隐蔽,作者不想通过鼠标移入移出的措施调整,假设自个儿想经过点击的艺术决定div的彰显与潜伏呢。对于js的不二等秘书诀来讲,这些便是接触的事件就可以了,对于插件来讲,只怕就改八个插件就行了!对于css3落实的话,那些就不但要改css样式了,也要改html结构了!
    此处,笔者的建议正是,那么些动画最杰出的照旧用js和css3结果,结果是最佳的。即便针对灵活性不高的须要,能够只用css3。

            .icon-logout {
                background: url(/mhims/img/index/logout.png) no-repeat center left;
            }

    4-4安然无恙代码

    JavaScript

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ec-css手风琴</title> <link rel="stylesheet" href="reset.css"> <style> .demo-slide-tab { width: 500px; margin: 0 auto; } .demo-slide-tab ul { width: 100%; margin: 0; padding: 0; } .demo-slide-tab li { list-style: none outside none; display: block; margin: 0; padding: 0; height: 40px; width: 100%; overflow: hidden; background: #f0f0f0; transition: height 0.3s ease-in-out; } .demo-slide-tab h3 { margin: 0; padding: 10px; height: 19px; border-top: 1px solid #f0f0f0; color: #000; background: #ccc; background: linear-gradient(#0099ff, #71d1fd); custor: pointer; position: relative; } .demo-slide-tab h3:before { content: ""; border-width: 5px; border-color: transparent transparent transparent #000; position: absolute; right: 10px; top: 15px; width: 0; height: 0; } .demo-slide-tab div { margin: 0; voerflow: auto; padding: 10px; max-height: 220px; } .demo-slide-tab li:hover { height: 280px; } .demo-slide-tab li:hover h3 { color: #fff; background: #000; background: linear-gradient(#faa305, #fcc054); } .demo-slide-tab li:hover h3:before{ border-color: transparent transparent transparent #fff; transform: rotate(90deg); } </style> </head> <body> <div class="demo-slide-tab"> <ul> <li> <h3>title 1</h3> <div>content1</div> </li> <li> <h3>title 2</h3> <div>content2conte nt2content2content2content2conten t2content2content2content2content2conte nt2content2content2content2conte nt2content2content2content2 content2content2content 2content2content2content2content2conten t2content2c ontent2content2content2</div> </li> <li> <h3>title 3</h3> <div>content3</div> </li> <li> <h3>title 4</h3> <div>content4.</div> </li> </ul> </div> </body> </html>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    <!DOCTYPE html>
     
    <html lang="en">
    <head>
     
    <meta charset="UTF-8">
    <title>ec-css手风琴</title>
    <link rel="stylesheet" href="reset.css">
    <style>
        .demo-slide-tab {
            width: 500px;
            margin: 0 auto;
        }
     
        .demo-slide-tab ul {
            width: 100%;
            margin: 0;
            padding: 0;
        }
     
        .demo-slide-tab li {
            list-style: none outside none;
            display: block;
            margin: 0;
            padding: 0;
            height: 40px;
            width: 100%;
            overflow: hidden;
            background: #f0f0f0;
            transition: height 0.3s ease-in-out;
        }
     
        .demo-slide-tab h3 {
            margin: 0;
            padding: 10px;
            height: 19px;
            border-top: 1px solid #f0f0f0;
            color: #000;
            background: #ccc;
            background: linear-gradient(#0099ff, #71d1fd);
            custor: pointer;
            position: relative;
        }
     
        .demo-slide-tab h3:before {
            content: "";
            border-width: 5px;
            border-color: transparent transparent transparent #000;
            position: absolute;
            right: 10px;
            top: 15px;
            width: 0;
            height: 0;
        }
     
        .demo-slide-tab div {
            margin: 0;
            voerflow: auto;
            padding: 10px;
            max-height: 220px;
        }
     
        .demo-slide-tab li:hover {
            height: 280px;
        }
     
        .demo-slide-tab li:hover h3 {
            color: #fff;
            background: #000;
            background: linear-gradient(#faa305, #fcc054);
        }
     
        .demo-slide-tab li:hover h3:before{
            border-color: transparent transparent transparent #fff;
            transform: rotate(90deg);
        }
    </style>
     
    </head>
    <body>
    <div class="demo-slide-tab">
     
    <ul>
        <li>
            <h3>title 1</h3>
            <div>content1</div>
        </li>
        <li>
            <h3>title 2</h3>
            <div>content2conte nt2content2content2content2conten t2content2content2content2content2conte nt2content2content2content2conte nt2content2content2content2 content2content2content 2content2content2content2content2conten t2content2c ontent2content2content2</div>
        </li>
        <li>
            <h3>title 3</h3>
            <div>content3</div>
        </li>
        <li>
            <h3>title 4</h3>
            <div>content4.</div>
        </li>
    </ul>
     
    </div>
    </body>
    </html>

            .icon-user-help {
                background: url(/mhims/img/index/user_help.png) no-repeat center left;
            }

    5.动画案例-无缝滚动

    图片 12

    如上海体育场合,无缝滚动也称跑马灯,就是部分内容,然后向左移动。鼠标放上去的时候,动画甘休!交互就疑似此,上边来看落到实处进程!

            .centerHeader {
                text-align: center;
            }

    5-1法则深入分析

    1.先是,最初状态便是如下图,然后向右稳步移动(黑框部分为可视区域)

    图片 13

    2.也就那样,滚动到结尾一张的时候,就能并发难点!如下图

    图片 14

    3.所以精确的姿势应该是,那样就须求对滚动内容张开复制一回了!

    图片 15

    4.但依旧幸免不了第二步的难题

    图片 16

    5.这里就必要做一步了,就是在刚滚动到下轮第一张的时候。如下图(用那几个案例说,不包涵复制出来的4个li,就累计有4个,各类200px,那么就是方ul滚动了800px的时候)图片 17

    6.滚动到这边,就一下子拉回来,回到原先的地方,再张开滚动操作(当ul滚动了800px的时候,须臾间拉回原本地方,也就是还一向不开头滚动)图片 18

            .bangzhu {
                padding: 5px;
            }

    5-2贯彻进程

    1.率先布局,便是在一个黑框正是三个div,酱色装着1234的正是ul-li布局!
    看上面的代码注释,再组成地点的规律,我们就很好掌握了!

    html代码如下

    JavaScript

    <div class="demo-marquee"> <ul class="fllil"> <li><img src="image/1.jpg"/> </li> <li><img src="image/2.jpg"/> </li> <li><img src="image/3.jpg"/> </li> <li><img src="image/4.jpg"/> </li> <!--上面包车型客车七个li是复制内容--> <li><img src="image/1.jpg"/> </li> <li><img src="image/2.jpg"/> </li> <li><img src="image/3.jpg"/> </li> <li><img src="image/4.jpg"/> </li> </ul> <div class="clear"></div> </div>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    <div class="demo-marquee">
        <ul class="fllil">
            <li><img src="image/1.jpg"/>
            </li>
            <li><img src="image/2.jpg"/>
            </li>
            <li><img src="image/3.jpg"/>
            </li>
            <li><img src="image/4.jpg"/>
            </li>
            <!--下面的四个li是复制内容-->
            <li><img src="image/1.jpg"/>
            </li>
            <li><img src="image/2.jpg"/>
            </li>
            <li><img src="image/3.jpg"/>
            </li>
            <li><img src="image/4.jpg"/>
            </li>
        </ul>
        <div class="clear"></div>
    </div>

    css代码

    JavaScript

    <style> .demo-marquee { width: 400px; margin: 20px auto; overflow: hidden; } .demo-marquee ul { /*以此案例ul宽度应为li个数*li宽度*/ width: 1600px; /*实施动画*/ animation: ec-marquee-move 6s infinite linear; } .demo-marquee ul:hover { /*鼠标放上去的时候,动画暂停*/ animation-play-state: paused; } /*概念动画*/ /*当向左滚动了800px的时候,这一年结束,然后有意还是无意回到源点,实行下三遍的动画片*/ @keyframes ec-marquee-move { 0% { transform: translateX(0px); } 100% { transform: translateX(-800px); } } </style>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    <style>
        .demo-marquee {
            width: 400px;
            margin: 20px auto;
            overflow: hidden;
        }
     
        .demo-marquee ul {
            /*这个案例ul宽度应该为li个数*li宽度*/
            width: 1600px;
            /*执行动画*/
            animation: ec-marquee-move 6s infinite linear;
        }
     
        .demo-marquee ul:hover {
            /*鼠标放上去的时候,动画暂停*/
            animation-play-state: paused;
        }
        /*定义动画*/
        /*当向左滚动了800px的时候,这个时候结束,然后顺便回到起点,进行下一次的动画*/
        @keyframes ec-marquee-move {
            0% {
                transform: translateX(0px);
            }
            100% {
                transform: translateX(-800px);
            }
        }
    </style>

                .bangzhu b {
                    line-height: 30px;
                    height: 30px;
                }

    5-3与JS达成相比

    1.这些动画,质量上圈套然是css3相比好,而浑圆上也迟早是。举例完结下边那些图这样效果。点击左右箭头切换方向!

    图片 19

    再有叁个正是,比如上面案例中,li的个数是生成的,那么ul的上涨的幅度也是要用js总计,以及ul的剧情要开展复制的话,以技士的思索,理应也是用js,实际不是手动复制!

    2.所以,那几个动画,提议的依然用js和css3结合使用,那样结果最佳,品质上和灵活上都获得折中,性能与价格之间比无疑是最佳的!

                .bangzhu a {
                    color: #333;
                    text-decoration: none;
                    line-height: 30px;
                    display: block;
                }

    5-4一体化代码

    JavaScript

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ec-css无缝滚动</title> <link rel="stylesheet" href="reset.css"> <style> .demo-marquee { width: 400px; margin: 20px auto; overflow: hidden; } .demo-marquee ul { width: 1600px; animation: ec-marquee-move 6s infinite linear; } .demo-marquee ul:hover { animation-play-state: paused; } @keyframes ec-marquee-move { 0% { transform: translateX(0px); } 百分之百 { transform: translateX(-800px); } } </style> </head> <body> <div class="demo-marquee"> <ul class="fllil"> <li><img src="image/1.jpg"/> </li> <li><img src="image/2.jpg"/> </li> <li><img src="image/3.jpg"/> </li> <li><img src="image/4.jpg"/> </li> <li><img src="image/1.jpg"/> </li> <li><img src="image/2.jpg"/> </li> <li><img src="image/3.jpg"/> </li> <li><img src="image/4.jpg"/> </li> </ul> <div class="clear"></div> </div> </body> </html>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>ec-css无缝滚动</title>
        <link rel="stylesheet" href="reset.css">
        <style>
            .demo-marquee {
                width: 400px;
                margin: 20px auto;
                overflow: hidden;
            }
     
            .demo-marquee ul {
                width: 1600px;
                animation: ec-marquee-move 6s infinite linear;
            }
     
            .demo-marquee ul:hover {
                animation-play-state: paused;
            }
     
            @keyframes ec-marquee-move {
                0% {
                    transform: translateX(0px);
                }
                100% {
                    transform: translateX(-800px);
                }
            }
        </style>
    </head>
    <body>
    <div class="demo-marquee">
        <ul class="fllil">
            <li><img src="image/1.jpg"/>
            </li>
            <li><img src="image/2.jpg"/>
            </li>
            <li><img src="image/3.jpg"/>
            </li>
            <li><img src="image/4.jpg"/>
            </li>
            <li><img src="image/1.jpg"/>
            </li>
            <li><img src="image/2.jpg"/>
            </li>
            <li><img src="image/3.jpg"/>
            </li>
            <li><img src="image/4.jpg"/>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
    </body>
    </html>

     

                    .bangzhu a:hover {
                        text-decoration: underline;
                        color: blue;
                    }

    5.总结

    至于css3,笔者的开荒小准则正是能用css3消除的,作者不会写js,然而借使要写js的,作者也不会小气到不写js,只用css3写出退而求之的职能!css3跟js搭配,能做出过多奇异的感动作效果果,那么些就得看大家脑洞有多大了!
    好了,后天经过八个案例带大家先导认知了css3的过渡和卡通片。希望能给我们起八个热身的功效,可能是大家看了这四个案例,知道怎么去付出别的的案例,发散思维!可是这么些只是css3连贯和卡通片的冰山一角而已,css3就算未有任何的新特色,就说过渡和动画片,吸重力就够用大,大家也足以到网络搜下css3的案例!就清楚css3的魅力了!关于css3的新个性,将来笔者会继续写小说。
    终极依旧那句老话,若是认为自家哪个地方写得不佳,写错了,接待带领!让我们互相学习,相互补助!

    1 赞 8 收藏 9 评论

    图片 20

            #leftTree ul li {
                cursor: pointer;
            }
        </style>
        <script type="text/javascript" src="Scripts/easyui/jquery.min.js"></script>
        <script type="text/javascript" src="Scripts/easyui/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="Scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
    </head>
    <body class="easyui-layout">
        <%--<div data-options="region:'north'" style="height:70px">
            <h1>西宁市水文监测种类</h1>
        </div>--%>
        <div data-options="region:'south',split:false" style="height: 30px;">
        </div>
        <div data-options="region:'west',split:true,title:'菜单',collapsible:false" style="width: 250px;">
            <div id="leftTree" class="easyui-accordion" data-options="fit:true,border:false">
                <div title=" GIS可视化" data-options="iconCls:'icon-world'" style="overflow: auto; padding: 10px;">
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "GIS/Map.aspx");'>电子地图
                        </li>
                    </ul>
                </div>
                <div title=" 在线监视" data-options="iconCls:'icon-computer'" style="padding: 10px;">
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "/OnlineMonitoring/monitor_main.aspx");'>实时监视
                        </li>
                        <li onclick='$("#content_iframe").attr("src", "/OnlineMonitoring/SynthesizeMonitor.aspx");'>综合监视
                        </li>
                        <li onclick='$("#content_iframe").attr("src", "/OnlineMonitoring/realTime_water_and_rain_situation.aspx");'>实时水雨情
                        </li>
                    </ul>
                </div>
                <div title="数据预先警告" data-options="iconCls:'icon-exclamation'" style="padding: 10px;">
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "/DataWarning/realtime_warning.aspx");'>实时报警
                        </li>
                        <li onclick='$("#content_iframe").attr("src", "/DataWarning/history_warning.aspx");'>历史告警
                        </li>
                    </ul>
                </div>
                <div title=" 数据宣布" data-options="iconCls:'icon-application_osx_cascade'" style="padding: 10px;">
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "/DataCheck/MonitoringDataOfAudit.aspx");'>监测数根据考证察
                        </li>
                        <li onclick='$("#content_iframe").attr("src", "/DataCheck/ContactManageMent.aspx");'>联系人管理
                        </li>
                          <li onclick='$("#content_iframe").attr("src", "/DataCheck/SMSMgr.aspx");'>短信管理
                        </li>
                    </ul>
                </div>
                <div title=" 数据分析" data-options="iconCls:'icon-chart_bar'" style="padding: 10px;">
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "DataAnalysis/pastdata.aspx");'>历史数据
                        </li>
                    </ul>
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "DataAnalysis/rainfall_data.aspx");'>雨量深入分析
                        </li>
                    </ul>
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "DataAnalysis/waterlevel_data.aspx");'>水位剖判
                        </li>
                    </ul>
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "DataAnalysis/comparison_r_w.aspx");'>雨量水位比对分析
                        </li>
                    </ul>
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "/DataWarning/history_warning.aspx");'>预先警告数据分析
                        </li>
                    </ul>
                </div>
                <div title=" 基础数据" data-options="iconCls:'icon-book'" style="padding: 10px;">
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "BaseInfo/monitoring_points_info.aspx");'>监测点管理
                        </li>
                    </ul>
                    <ul>
                        <li onclick='$("#content_iframe").attr("src", "BaseInfo/factor_info.aspx");'>监测因子管理
                        </li>
                    </ul>
                </div>
                <div title=" 系统管理" data-options="iconCls:'icon-cog'" style="padding: 10px;">
                </div>
            </div>
        </div>
        <div data-options="region:'center',title:' 主页',iconCls:'icon-house'" style="padding: 0px; overflow: hidden">
            <iframe id="content_iframe" scrolling="yes" frameborder="0" src="GIS/Map.aspx" style="width: 100%; height: 100%;"></iframe>
        </div>
    </body>
    </html>

    图片 21

    本文由新葡亰496net发布于新葡亰官网,转载请注明出处:EasyUI左右布居,CSS实现鼠标放图片上显得铜锈绿

    关键词:

上一篇:新葡亰496net:li精粹案例,盒子模型

下一篇:没有了