下载模板上的HTML动画

时间:2017-03-07 13:13:07

标签: javascript html animation

我对html编程比较陌生。我和我的朋友想要一个wep页面,这就是我下载免费模板的原因。

在这个模板中有"团队"部分。因为事实上,并非所有内容都适合第一页,我们不想让按钮点击,我们希望它是动画的(它应该水平滚动以显示所有团队成员,不应该停止)

你有什么代码,tipps,关键词等可以帮助我做到这一点吗?

屏幕:

How it looks like now

代码



5

/* Team Section */
#tf-team{
	background: url(../img/03.jpg);
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	background-repeat: no-repeat;
	color: #ffffff;
}
#tf-team .overlay{
	background: -moz-linear-gradient(top,  rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.73) 17%, rgba(0,0,0,0.66) 35%, rgba(0,0,0,0.55) 62%, rgba(0,0,0,0.4) 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.8)), color-stop(17%,rgba(0,0,0,0.73)), color-stop(35%,rgba(0,0,0,0.66)), color-stop(62%,rgba(0,0,0,0.55)), color-stop(100%,rgba(0,0,0,0.4))); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(top,  rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.73) 17%,rgba(0,0,0,0.66) 35%,rgba(0,0,0,0.55) 62%,rgba(0,0,0,0.4) 100%); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(top,  rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.73) 17%,rgba(0,0,0,0.66) 35%,rgba(0,0,0,0.55) 62%,rgba(0,0,0,0.4) 100%); /* Opera 11.10+ */
	background: -ms-linear-gradient(top,  rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.73) 17%,rgba(0,0,0,0.66) 35%,rgba(0,0,0,0.55) 62%,rgba(0,0,0,0.4) 100%); /* IE10+ */
	background: linear-gradient(to bottom,  rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.73) 17%,rgba(0,0,0,0.66) 35%,rgba(0,0,0,0.55) 62%,rgba(0,0,0,0.4) 100%); /* W3C */
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc000000', endColorstr='#66000000',GradientType=0 ); /* IE6-9 */
	height: auto;
	background-attachment: fixed;
	padding: 80px 0;
}
.section-title.center{
	padding: 30px 0;
}
.section-title h2,
.section-title.center h2{
	font-weight: 300;
}
.section-title.center .line{
	border-top: 4px solid #fcac45;
	height: 10px;
	width: 60px;
	text-align: center;
	margin: 0 auto;
	margin-top: 20px;
}

.section-title.center hr {
	border-top: 4px solid rgba(252, 172, 69, 0.34);
	width: 40px;
	text-align: center;
	margin-top: 10px;
	position: relative;
	left: 17%;
}
#team{ margin: 0 auto}
#team .item{
    padding: 0;
    margin: 15px;
    color: #FFF;
    text-align: center;
}

img.img-circle.team-img {
	width: 120px;
	height: 120px;
	border: 4px solid transparent;
	transition: all 0.5s;
}
#tf-team .item .thumbnail:hover>img.img-circle.team-img{
	border: 4px solid #FCAC45;
}
#tf-team .thumbnail {
	background: transparent;
	border: 0;
}

#tf-team .thumbnail .caption {
	padding: 9px;
	color: #F2F2F2;
}

.owl-theme .owl-controls .owl-page span {
	display: block;
	width: 10px;
	height: 10px;
	margin: 5px 7px;
	filter: Alpha(Opacity=1);
	opacity: 1;
	-webkit-border-radius: 0;
	-moz-border-radius: 20px;
	border-radius: 0;
	background: #FFFFFF;
	transition: all 0.5s;
}

.owl-theme .owl-controls .owl-page.active span, 
.owl-theme .owl-controls.clickable .owl-page:hover span {
	filter: Alpha(Opacity=100);
	opacity: 1;
	background: #FFFFFF;
}
.owl-theme .owl-controls .owl-page.active span{
	background: #FCAC45;
}




1 个答案:

答案 0 :(得分:0)

您可以使用bootstrap carousel为其设置动画。 就像在这个例子中: 每页并排显示四张图片,页面会自动更改。

.item img {width: 25%; height: auto; float:left;}

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://placehold.it/450x350" alt="Slide 1">
      <img src="http://placehold.it/450x350" alt="Slide 1">
       <img src="http://placehold.it/450x350" alt="Slide 1">
      <img src="http://placehold.it/450x350" alt="Slide 1">

    </div>
    <div class="item">
      <img src="http://placehold.it/450x350" alt="Slide 2">
      <img src="http://placehold.it/450x350" alt="Slide 2">
       <img src="http://placehold.it/450x350" alt="Slide 2">
      <img src="http://placehold.it/450x350" alt="Slide 2">

    </div>
    <div class="item">
      <img src="http://placehold.it/450x350" alt="Slide 3">
      <img src="http://placehold.it/450x350" alt="Slide 3">
       <img src="http://placehold.it/450x350" alt="Slide 3">
      <img src="http://placehold.it/450x350" alt="Slide 3">

    </div>        
  </div>

</div>

link

或者您可以使用owl:

为其设置动画
var owl = $('.owl-carousel');
owl.owlCarousel({
    items:4,
    loop:true,
    margin:10,
    autoplay:true,
    autoplayTimeout:1000,
    autoplayHoverPause:true
});

owl.trigger('play.owl.autoplay',[1000])

link