简体   繁体   English

自动垂直图像滑块

[英]Automatic Vertical image slider

I need help to create a vertical image slider which slides the image automatically with interval. 我需要帮助来创建一个垂直图像滑块,它会间隔地自动滑动图像。

HTML: HTML:

<div id="myCarousel" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="active item">
<img src="img/1.jpg" />
</div>
<div class="item">
<img src="img/2.jpg" />
</div>
<div class="item">
<img src="img/3.jpg" />
</div>
<div class="item">
<img src="img/4.jpg" />
</div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>

Javascript: 使用Javascript:

<script type="text/javascript">
$(document).ready(function () {
$('.carousel').carousel({ interval: 3000 });
});
</script>

I need the same thing vertically. 我需要垂直相同的东西。

I would suggest you to use jCarousel or bxslider . 我建议你使用jCarouselbxslider Take a look at this and this for vertical-scroll example pf jCarousel and this for bxslider example 看一下这个这个用于垂直滚动示例pf jCarousel, 这个用于bxslider示例

Here is a sample of how to use CSS3 and HTML5 to get the effect of a vertical slider. 以下是如何使用CSS3和HTML5获取垂直滑块效果的示例。

https://jsfiddle.net/cd3oezzj/ https://jsfiddle.net/cd3oezzj/

Uses @keyframes rule. 使用@keyframes规则。 @-webkit-keyframes may be required for some browsers. 某些浏览器可能需要@-webkit-keyframes

您可以使用

$(window).scrollTop()

just put this below: 把这个放在下面:

<script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src= "js/bootstrap.js"></script>
 <script type="text/javascript">
     var $ = jQuery.noConflict();
     $(document).ready(function() { 
     $('#myCarousel').carousel({ interval: 2000, cycle: true });
     }); 
</script>   

plz maimtain the sequence as i maintain... plz按照我维持的顺序编制序列...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM