300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > php广告轮播效果 使用swiper组件实现轮播广告效果

php广告轮播效果 使用swiper组件实现轮播广告效果

时间:2020-09-17 02:20:51

相关推荐

php广告轮播效果 使用swiper组件实现轮播广告效果

这次给大家带来使用swiper组件实现轮播广告效果,使用swiper组件实现轮播广告效果的注意事项有哪些,下面就是实战案例,一起来看一下。

1、安装swipernpm install swiper@3.4.1 --save-dev

2、引用组件import Swiper from 'swiper';

import 'swiper/dist/css/swiper.min.css';

3、html页面代码

4、初始化组件,并设置参数setTimeout(function () {

state.swiperObj = new Swiper('#swiper', {

loop: true,

pagination: '.swiper-pagination',

autoplay: 2000,

paginationClickable: true

});

}, 100)

5、搞定,ok

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。