swiper移动端全屏播放动态获取数据
2024-09-06 14:47:52
html:
<link rel="stylesheet" href="css/swiper.min.css">
<div class="swiper-container s-c">
<div class="swiper-wrapper"></div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
<!-- Add Arrows -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
<script src="js/swiper.min.js"></script>
js:
var vm = new Vue({
el:'#app',
data:{
imgs:[
{thumb:"https://goss.veer.com/creative/vcg/veer/800water/veer-308318668.jpg"},
{thumb:"https://goss.veer.com/creative/vcg/veer/800water/veer-308318668.jpg"},
{thumb:"https://goss.veer.com/creative/vcg/veer/800water/veer-308318668.jpg"},
{thumb:"https://goss.veer.com/creative/vcg/veer/800water/veer-308318668.jpg"},
{thumb:"https://goss.veer.com/creative/vcg/veer/800water/veer-308318668.jpg"},
{thumb:"https://goss.veer.com/creative/vcg/veer/800water/veer-308318668.jpg"},
], },
created: function(){ },
mounted:function(){
var self = this;
var imgs = self.imgs;
for (var i = 0, len = imgs.length; i < len; i++) {
var html = '<div class="swiper-slide"><img src="' + imgs[i].thumb + '"/></div>'
$('.swiper-wrapper').append(html)
}
var swiper = new Swiper('.swiper-container', {
pagination: {
el: '.swiper-pagination',
type: 'fraction',
},
loop: true, //为 true循环
autoplay: false, //为 true自动播放到下一张
init: true, //为true自动执行,不用调用
disableOnInteraction: false,
}); },
methods:{ },
filters:{ } })
最新文章
- IOS入门之Swift语言(一)
- win10 服务(系统默认服务)注册表
- Asp.Net Web Form 前后台传值
- Java Programming Test Question 1
- IOS第十天(1:QQ好友列表 ,自定义的headview,代理 ,通知 ,black的使用)
- JS 将字符串转换成日期类型
- schedule() 和 scheduleAtFixedRate() 区别
- log4js
- Ctrl+Shift+F12切换最大化编辑器
- Exception not a valid month
- Hibernate jar包详解
- 字符串转Json对象
- 一个包的net到gs流程
- mysql官方示例数据库
- STL算法
- [Whole Web, Node.js PM2] Loggin with PM2
- nutch 很多url unfetched的原因
- meanShift算法介绍
- 带有机器人框架的.NET自己主动化測试
- Python 递归计算分数数列