发表于: 2017-05-20 23:46:23

1 1019


今天完成的事情:修改了服务流程样式,写伙伴之言轮播

明天计划的事情:写找精英静态页面

遇到的问题:

一、点击最新职位的轮播切换按钮,会改变url,

http://localhost:1004/#/home  => http://localhost:1004/#/newProfession-carousel


这样刷新页面时会导致ui-router的ui-sref错误,从而路由页面为空:



二、服务流程是按五等分的,直接用栅格的col会分不出来,所以要用到col-xx-offset

给第一个栅格加上col-md-offset-1向左偏移一个栅格单位。

<div class="col-md-offset-1 col-md-2 col-xs-12 home-step">



三、官网写的伙伴之言很绕,还是没弄懂,先不管它了。


思路一:

先建6个组轮播区域,每组有6个小轮播块。每次只一组显示轮播区域中间4个(用-margin和overflow:hidden),每次自动或点击轮播先在当前页面轮播一个小轮播块(用jq的animate()方法实现。),然后用下一组或则上一组轮播区域代替。

612345

123456

234561

345612

156123

561234


其的实现:用纯css也写了一下,能够单个跳转,但不能循环:

html:

<div class="wrap-carousel">
   <div class="carousel">
       <img src="image/banner-1.jpg">
       <img src="image/banner-2.jpg">
       <img src="image/banner-3.jpg">
       <img src="image/banner-1.jpg">
       <img src="image/banner-2.jpg">
       <img src="image/banner-3.jpg">
   </div>
</div>


css:

.wrap-carousel {
overflow: hidden;
}
.carousel {
width: 300%;
overflow: hidden;
animation: ma 27s ease-out infinite;
}
.carousel img {
float: left;
width: 33.3333333%;
}
@keyframes ma {
0%,
30% {
margin-left: 0px;
}
35%,
66% {
margin-left: -100%;
}
71%,
100% {
margin-left: -200%;
}
}


收获:如上


返回列表 返回列表
评论

    分享到