css3伪类元素

  <section class="timeline">
                <div class="wrapper">
                    <div class="timeline__item timeline__item--0">
                        <div class="timeline__item__station"></div>
                        <div class="timeline__item__content">
                            <div class="timeline__item__content__ZhenHR"></div>
                            <p>ZhenHR人力服务</p>
                            <p class="timeline__item__content__description">一站式人力解决资源</p >
                        </div>
                    </div>
                    <div class="timeline__item timeline__item--1">
                        <div class="timeline__item__station"></div>
                        <div class="timeline__item__content">
                            <div class="timeline__item__content__ZhenHR"></div>
                            <p>ZhenHR招聘</p>
                            <p class="timeline__item__content__description">攒团队,搭班子</p >
                        </div>
                    </div>

                    <div class="timeline__item timeline__item--2">
                        <div class="timeline__item__station a1P a2P"></div>
                        <div class="timeline__item__content a1 a2">
                            <div class="timeline__item__content__ZhenHR"></div>
                            <p>ZhenHR战略咨询</p>
                            <p class="timeline__item__content__description">团队结构梳理,竞争力咨询</p >
                        </div>
                    </div>
                    <div class="timeline__item timeline__item--3">
                        <div class="timeline__item__station a1P"></div>
                        <div class="timeline__item__content a1">
                            <div class="timeline__item__content__ZhenHR"></div>
                            <p>财务法务服务</p>
                            <p class="timeline__item__content__description">社保代缴,团队薪酬体系搭建</p >
                        </div>
                    </div>
                    <div class="timeline__item timeline__item--4 ">
                        <div class="timeline__item__station a1P a2P a3P"></div>
                        <div class="timeline__item__content a1 a2 a3">
                            <div class="timeline__item__content__ZhenHR"></div>
                            <p>战略布局</p>
                            <p class="timeline__item__content__description">商业,盈利与变现模式梳理</p >
                        </div>
                    </div>
                    <div class="timeline__item timeline__item--5 ">
                        <div class="timeline__item__station"></div>
                        <div class="timeline__item__content ">
                            <div class="timeline__item__content__ZhenHR"></div>
                            <p>股权资本管理</p>
                            <p class="timeline__item__content__description">合理化股权架构,融资对接</p >
                        </div>
                    </div>
                </div>
            </section>

   <style>
            @import url('https://fonts.googleapis.com/css?family=Nunito:300,400,700');
            * {
                box-sizing: border-box;
            }
            body {
                font-family: 'Nunito', sans-serif;
                /*background: -webkit-linear-gradient(right, #BE93C5 , #7BC6CC);*/
                /*background: linear-gradient(to left, #BE93C5 , #7BC6CC);*/
            }
            img {
                max-width: 100%;
                height: auto;
            }

            /* _site-header.css */
            .site-header {
                text-align: center;
                padding: 40px 0;

            }

            .site-header__title {
                font-size: 16px;
                color: #fff;
            }

            /* _wrapper.css */
            .wrapper {
                padding-left: 18px;
                padding-right: 18px;
                max-width: 1236px;
                margin-left: auto;
                margin-right: auto;
            }

            /* _timeline.css */
            .timeline {
                width: 635px;
                position: relative;
                margin: 0px auto;

            }

            .timeline::before {
                content: "";
                position: absolute;
                top: 0;
                left: 10%;
                width: 2px;
                height: 100%;
                background-color: #d9592e;
            }

            @media (min-width: 800px) {
                .timeline::before {
                    left: 50%;
                    margin-left: -1px;
                }
            }

            .timeline__item {
                height: 70px;
                position: relative;
            }

            .timeline__item::after {
                content: "";
                clear: both;
                display: table;
            }

            .timeline__item:nth-child(2n) .timeline__item__content {
                float: right;
            }

            .timeline__item:nth-child(2n) .timeline__item__content::before {
                content: '';
                right: 36%;
            }

            @media (min-width: 800px) {
                .timeline__item:nth-child(2n) .timeline__item__content::before {
                    left: inherit;
                }
            }

            .timeline__item:nth-child(2n) .timeline__item__content__date {
                background-color: #b292c5;
            }

            .timeline__item:nth-child(2n) .timeline__item__content__description {
                color: #999999;
            }

            .timeline__item:last-child {
                margin-bottom: 0;
            }

            .timeline__item-bg {
                -webkit-transition: all 1s ease-out;
                transition: all 1s ease-out;
                color: #fff;
            }

            .timeline__item-bg:nth-child(2n) .timeline__item__station {
                background-color: #b292c5;
            }

            .timeline__item-bg:nth-child(2n) .timeline__item__content {
                background-color: #b292c5;
            }

            .timeline__item__content::after {
                content: '';
                position: absolute;
                left: 271px;
                background: #d9592e;
                top: 64px;
                width: 30px;
                height: 2px;
                z-index: -1;
                -webkit-transition: all .3s ease-out;
                transition: all .3s ease-out;
                transform: rotate(45deg);
                -ms-transform: rotate(45deg); /* IE 9 */
                -moz-transform: rotate(45deg); /* Firefox */
                -webkit-transform: rotate(45deg); /* Safari 和 Chrome */
                -o-transform: rotate(45deg);
            }
 			 .timeline__item__content.change::after {
                content: '';
                position: absolute;
                left: 271px;
                background: #c2c2c2;
                top: 64px;
                width: 30px;
                height: 2px;
                z-index: -1;
                -webkit-transition: all .3s ease-out;
                transition: all .3s ease-out;
                transform: rotate(45deg);
                -ms-transform: rotate(45deg); /* IE 9 */
                -moz-transform: rotate(45deg); /* Firefox */
                -webkit-transform: rotate(45deg); /* Safari 和 Chrome */
                -o-transform: rotate(45deg);
            }
            .timeline__item:nth-child(2n) .timeline__item__content.change::after{
                background: #c2c2c2;
            }
            .timeline__item:nth-child(2n) .timeline__item__content::after {
                content: '';
                position: absolute;
                left: 300px;
                background: #d9592e;
                top: 64px;
                width: 30px;
                height: 2px;
                z-index: -1;
                -webkit-transition: all .3s ease-out;
                transition: all .3s ease-out;
                transform: rotate(-45deg);
                -ms-transform: rotate(-45deg); /* IE 9 */
                -moz-transform: rotate(-45deg); /* Firefox */
                -webkit-transform: rotate(-45deg); /* Safari 和 Chrome */
                -o-transform: rotate(-45deg);
            }

            .timeline__item-bg:nth-child(2n) .timeline__item__content::before {
                background-color: #b292c5;
            }

            .timeline__item:nth-child(2n) .timeline__item__content {
                width: 40%;
                float: inherit;
                padding: 10px 10px;
                margin-bottom: 20px;
                margin-left: 380px;
            }

            .timeline__item-bg:nth-child(2n) .timeline__item__content__description {
                color: #fff;
            }

            .timeline__item-bg .timeline__item__station {
                background-color: #65adb7;
            }

            .timeline__item-bg .timeline__item__content {
                background-color: #65adb7;
            }

            .timeline__item-bg .timeline__item__content::before {
                background-color: #65adb7;
            }

            .timeline__item-bg .timeline__item__content__description {
                color: #fff;
            }
            .timeline__item__station {
                background-color: #d9592e;
                width: 5px;
                height: 5px;
                position: absolute;
                border-radius: 50%;
                padding: 10px;
                top: 70px;
                left: 10%;
                margin-left: -22px;
                border: 1px solid #d9592e;
                -webkit-transition: all .3s ease-out;
                transition: all .3s ease-out;
            }
			.timeline__item__station.change{
				border: 6px solid #bfbfbf;
			}

            @media (min-width: 800px) {
                .timeline__item__station {
                    left: 50%;
                    margin-left: -6px;
                    width: 1px;
                    height: 5px;
                    padding: 0px;
                    border-width: 6px;
                }
            }

            .timeline__item__content {
                height: 74px;
                width: 80%;
                background: #fff;
                margin-bottom: 30px;
                border-radius: 6px;
                float: right;
                -webkit-transition: all .3s ease-out;
                transition: all .3s ease-out;
                border: 1px solid #d9592e;
            }
			.timeline__item__content.change {

				border: 1px solid #bfbfbf;
			}

            @media (min-width: 800px) {
                .timeline__item__content {
                    width: 40%;
                    float: inherit;
                    padding: 10px 10px;
                    margin-bottom: 20px;
                    margin-left: -19px;
                }
            }

            .timeline__item__content::before {
                content: '';
                position: absolute;
                left: 218px;
                background: #d9592e;
                top: 54px;
                width: 57px;
                height: 2px;
                z-index: -1;
                -webkit-transition: all .3s ease-out;
                transition: all .3s ease-out;
            }
			.timeline__item__content.change::before {
				content: '';
				position: absolute;
				left: 218px;
				background: #c2c2c2;
				top: 54px;
				width: 57px;
				height: 2px;
				z-index: -1;
				-webkit-transition: all .3s ease-out;
				transition: all .3s ease-out;
			}

            @media (min-width: 800px) {
                .timeline__item__content::before {
                    left: 218px;
                    top: 54px;
                    height: 2px;
                }
            }

            /*@media (min-width: 800px){*/
            /*.timeline__item__content::after{*/
            /*left: 20%;*/
            /*height: 2px;*/
            /*margin-top: -2px;*/
            /*transform:rotate(7deg);*/
            /*-ms-transform:rotate(7deg); 	!* IE 9 *!*/
            /*-moz-transform:rotate(7deg); 	!* Firefox *!*/
            /*-webkit-transform:rotate(7deg); !* Safari 和 Chrome *!*/
            /*-o-transform:rotate(7deg);*/
            /*}*/
            /*}*/
            .timeline__item__content__date {
                margin: 0;
                padding: 8px 12px;
                font-size: 15px;
                margin-bottom: 10px;
                background-color: #65adb7;
                color: #fff;
                display: inline-block;
                border-radius: 4px;
                border: 2px solid #fff;
            }

            .timeline__item__content__description {
                margin: 0;
                padding: 0;
                font-size: 16px;
                line-height: 24px;
                font-weight: 300;
                color: #999999;
            }

            @media (min-width: 800px) {
                .timeline__item__content__description {
                    font-size: 14px;
                    line-height: 18px;
                }
            }

        </style>

  js

  $('.financing').change(function () {
                $('.timeline__item--1 p').removeClass('changeP');
                $('.timeline__item--2 p').removeClass('changeP');
                $('.timeline__item--3 p').removeClass('changeP');
                $('.timeline__item--4 p').removeClass('changeP');
                $('.timeline__item--5 p').removeClass('changeP');
                $('.timeline__item--6 p').removeClass('changeP');
                $('.a1').removeClass('change');
                $('.a1P').removeClass('change');

                var str = $('.financing').val();
                if(str == 1){
                    $('.timeline__item--2 p').addClass('changeP');
                    $('.timeline__item--3 p').addClass('changeP');
                    $('.timeline__item--4 p').addClass('changeP');
                    $('.a1').addClass('change');
                    $('.a1P').addClass('change');
                }else if(str ==2){
                    $('.timeline__item--2 p').addClass('changeP');
                    $('.timeline__item--4 p').addClass('changeP');
                    $('.a2').addClass('change');
                    $('.a2P').addClass('change');
                }else if(str ==3){
                    $('.timeline__item--4 p').addClass('changeP');
                    $('.a3').addClass('change');
                    $('.a3P').addClass('change');
                }else if(str ==4){

                }
            })

 

转载于:https://www.cnblogs.com/yangbo1993/p/6812002.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值