|
本帖最后由 comxgb 于 2017-4-12 17:57 编辑
如何实现广告动态栏文字,隔2秒向上滚动的效果
高度只有30,宽度100%
纯文本
我弄了半天还没弄好
没人帮忙吗?
我自己写了些代码,但是不正常,一开始就显示2222,然后一直循环显示22222,33333,44444,444444,然后又22222,33333,44444,444444
按理应该是,1111,2222,3333,4444的轮播顺序
代码如下
- <style>
- .opop {
- height: 30px;
- background-color: #CCCCCC;
- padding: 0px;
- margin: 0px;
- width:100%;
- }
- </style>
- <div class="opop swiper-container">
- <div class="swiper-wrapper opop" id="swiper">
- <div class="swiper-slide opop">111111111</div>
- </div>
- <div class="swiper-wrapper opop" id="swiper">
- <div class="swiper-slide opop" >22222222222</div>
- </div>
- <div class="swiper-wrapper opop" id="swiper">
- <div class="swiper-slide opop" >333333333</div>
- </div>
- <div class="swiper-wrapper opop" id="swiper">
- <div class="swiper-slide opop" >4444444444</div>
- </div>
- </div>
- <script type="text/javascript" src="../script/swiper-3.4.2.min.js"></script>
- <script>
- var mySwiper3 = new Swiper('.opop', {
- loop : true,
- direction: 'vertical',
- autoplay : 3000,
- })
- </script>
复制代码
|
|