所以经过一番努力,我设法让我的旋转木马在我的网页上工作,一切正常,但我希望旋转木马只向左或向右滑动一个图像而不是全部。这有可能吗?
HTML:
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- jQuery (necessary for Bootstrap's Javascript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.js"></script>
<!-- Header + Navigation Stylesheet -->
<link rel="stylesheet" type="text/css" href="Header_CSS.css"/>
</head>
<!-- Body -->
<body>
<div id="back_carousel"><p></p></div>
<div class="<a href="#" id="_GPLITA_0" in_rurl="http://i.display-trk.com/click?v=Tkw6NTg5ODE6MTE1MDpjb250YWluZXI6ZDQ1ODdjOTgxNzBhMWFhZjBkYTNkYjZiMGY0YzI0MTQ6ei0xNzUwLTQ1ODUxNjp3d3cuZHJlYW1pbmNvZGUubmV0OjE4MTU3MjowOjBkNjkzMDQ3YWFjZDRlMTViZTFhMGIxYmY3MTg4YmI2OjE&subid=g-458516-1f06d94172a34404b791c3395bb688bc-&data_tagname=PRE" title="Click to Continue > by NextCoup" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">container<img src="http://cdncache-a.akamaihd.net/items/it/img/arrow-10x10.png" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: 10px !important; margin: 0px 0px 0px 3px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: super !important; width: 10px !important; background: transparent !important;"></a>-fluid">
<div class="row-fluid">
<div class="span12">
<div class="carousel slide" id="myCarousel">
<div class="carousel-inner">
<div class="item active">
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="Galaxy.png" alt=""></a>
</div>
<div class="caption">
<h4>Samsung S5</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="lg g2.png" alt=""></a>
</div>
<div class="caption">
<h4>LG G3</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="Windows9.png" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="htc.png" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="beats.png" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
</li>
</ul>
</div><!-- /Slide1 -->
<div class="item">
<ul class="thumbnails">
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="Galaxy.png" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
<li class="span3">
<div class="thumbnail">
<a href="#"><img src="http://placehold.it/360x240" alt=""></a>
</div>
<div class="caption">
<h4>Praesent commodo</h4>
<p>Nullam Condimentum Nibh Etiam Sem</p>
</div>
</li>
</ul>
</div><!-- /Slide2 -->
</div>
<div class="control-box">
<a data-slide="prev" href="#myCarousel" class="carousel-control left"><br/><br/><br/><br/><br/><br/><h2><</h2></a>
<a data-slide="next" href="#myCarousel" class="carousel-control right"><br/><br/><br/><br/><br/><br/><h2>></h2></a>
</div><!-- /.control-box -->
</div><!-- /#myCarousel -->
</div><!-- /.span12 -->
</div><!-- /.row -->
</div><!-- /.container -->
</body>
</html>
<!-- Nav end -->
CSS:
![#myCarousel{
position:absolute;
top:80px;
left:10px;
right:10px;
text-align:left;
background-color:#C2C2C2;
z-index:1;
}
#back_carousel{
position:relative;
top:-15spx;
width: 2000px;
height:278px;
background-color:#C2C2C2;
}
/* Global */
img { max-width:100%;
border: 1px solid black;
}
a {
-webkit-transition: all 150ms ease;
-moz-transition: all 150ms ease;
-ms-transition: all 150ms ease;
-o-transition: all 150ms ease;
transition: all 150ms ease;
}
.thumbnail a:hover {
-ms-filter: "progid:DXImageTransform.<a href="#" id="_GPLITA_1" in_rurl="http://i.display-trk.com/click?v=Tkw6NTg5ODE6MTE1MDptaWNyb3NvZnQ6ODNlN2FlNjc2ZTU2YWRjZGE1MGNmOTBhZTBkYmJmZDc6ei0xNzUwLTQ1ODUxNjp3d3cuZHJlYW1pbmNvZGUubmV0OjE4MTU3MjowOmE0YTNiZjljMDAzMjQyZjE5YTJjMmMzMzhhMjJjOWQ0OjE&subid=g-458516-1f06d94172a34404b791c3395bb688bc-&data_tagname=PRE" title="Click to Continue > by NextCoup" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">Microsoft<img src="http://cdncache-a.akamaihd.net/items/it/img/arrow-10x10.png" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: 10px !important; margin: 0px 0px 0px 3px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: super !important; width: 10px !important; background: transparent !important;"></a>.Alpha(Opacity=50)"; /* IE 8 */
filter: alpha(opacity=50); /* IE7 */
opacity: 0.65;
text-decoration: none;
}
/* Container */
.container-fluid {
width:1000px;
padding-bottom:0px;
}
/* Thumbnail Box */
.caption h4 {
position:absolute;
top:230px;
color:white;
font-size: 0.8em;
font-weight:400;
text-shadow: 1px 1px 3px #000;
font-family: Jubilat,Georgia,serif;
padding:0px;
margin:0px;
text-indent: 15px;
}
.caption p {
font-size: 0.75rem;
color: green;
text-indent: 15px;
margin:0px;
padding:0px;
}
/* Carousel Control */
.control-box {
z-index: 10;
text-align: right;
width: 100%;
}
.carousel-control {
position:absolute;
z-index:10;
background:transparent;
border: 0px;
border-radius:0px;
display: inline-block;
font-family: Sans serif;
font-size: 34px;
font-weight: 200;
line-height: 18px;
opacity: 0.5;
padding: 4px 10px 0px;
height: 274px;
width: 15px;
text-decoration:none;
}
/* Mobile Only */
@media (max-width: 767px) {
.page-header, .control-box {
text-align: center;
}
}
@media (max-width: 479px) {
.caption {
word-break: break-all;
}
}
/*!
* Bootstrap v3.2.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
right:5px;
width: 1910px;
overflow: hidden;
}
.carousel-inner > .item {
position: relative;
display: none;
-webkit-transition: .6s ease-in-out left;
-o-transition: .6s ease-in-out left;
transition: .6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: 2px 3px 2px rgba(0, 0, 0, .9);
filter: alpha(opacity=50);
opacity: .6;
}
.carousel-control.left {
left: -15;
right:<a href="#" id="_GPLITA_2" in_rurl="http://i.display-trk.com/click?v=Tkw6NDk3MzU6MTMwNDphdXRvczpmMTUxOWRiNmJjZDE5OTcwMWJjNzdmMDMwZjUyODU0Nzp6LTE3NTAtNDU4NTE2Ond3dy5kcmVhbWluY29kZS5uZXQ6MjA4MTAzOmVkMDVkZjNlZDhlNGU4Zjc0ZWMwMWNlNjIyNmQzMjFhOjVlMGQxYzU0ODlkYzQ0Zjc4YWUyNDFmMmJjNjY0NzdlOjE&subid=g-458516-1f06d94172a34404b791c3395bb688bc-&data_tagname=PRE" title="Click to Continue > by NextCoup" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">auto<img src="http://cdncache-a.akamaihd.net/items/it/img/arrow-10x10.png" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: 10px !important; margin: 0px 0px 0px 3px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: super !important; width: 10px !important; background: transparent !important;"></a>;
max-width:100px;
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control.right {
max-width:100px;
right: -15;
left: <a href="#" id="_GPLITA_3" in_rurl="http://i.display-trk.com/click?v=Tkw6NDk3MzU6MTMwNDphdXRvczpkN2RkNzZhOWIwOWY3MWM5YTRkMWMxZTlkYmNkNDczZDp6LTE3NTAtNDU4NTE2Ond3dy5kcmVhbWluY29kZS5uZXQ6OTcwNTM6MWUwNzZkMTdiYmE2MWQxOTU2YTk2OGVhNTQxNjY0ZjA6M2IzMWU1MjEwZWIxNDZiYWJlY2E1NmU3OWUyZDRhY2Q6MQ&subid=g-458516-1f06d94172a34404b791c3395bb688bc-&data_tagname=PRE" title="Click to Continue > by NextCoup" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">auto<img src="http://cdncache-a.akamaihd.net/items/it/img/arrow-10x10.png" style="border: none !important; display: inline-block !important; text-indent: 0px !important; float: none !important; font-weight: bold !important; height: 10px !important; margin: 0px 0px 0px 3px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; text-decoration: underline !important; vertical-align: super !important; width: 10px !important; background: transparent !important;"></a>;
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control:hover,
.carousel-control:focus {
color: #fff;
text-decoration: none;
filter: alpha(opacity=90);
outline: 0;
opacity: .9;
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 6px;
margin-left: -10px;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
margin-right: -10px;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
padding-left: 0;
margin-left: -30%;
text-align: center;
list-style: none;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
border: 1px solid #fff;
border-radius: 10px;
}
.carousel-indicators .active {
width: 12px;
height: 12px;
margin: 0;
background-color: #fff;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 20px;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
font-size: 30px;
}
.carousel-control .glyphicon-chevron-left,
.carousel-control .icon-prev {
margin-left: -15px;
}
.carousel-control .glyphicon-chevron-right,
.carousel-control .icon-next {
margin-right: -15px;
}
.carousel-caption {
right: 20%;
left: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}][1]