Authored by 沈志敏

增加预览模式

... ... @@ -39,7 +39,7 @@
{{#isEqualOr type 'marquee' 'swiper'}}
{{! 轮播/滑动}}
<div class="swiper-container {{type}}" data-loop="{{loop}}" {{#if autoplay}}data-autoplay="{{autoplay}}"{{/if}}>
<div class="swiper-container {{type}}" data-loop="{{loop}}" {{#if spaceBetween}}data-spacebetween="{{spaceBetween}}"{{/if}} {{#if autoplay}}data-autoplay="{{autoplay}}"{{/if}}>
<div class="swiper-wrapper">
{{#list}}
<div class="swiper-slide" style="{{styleFormat this percent=1}}">
... ...
... ... @@ -10,12 +10,14 @@ function swiperInit() {
$('.swiper-container').each(function() {
var opt = {
loop: $(this).data('loop') === '1' ? true : false,
spaceBetween: 15,
slidesPerView: 'auto'
};
var spacebetween = $(this).data('spacebetween');
var autoplay = $(this).data('autoplay');
var pagination = $(this).find('.swiper-pagination');
if (spacebetween) {
opt.spaceBetween = Number(spacebetween);
}
if (autoplay) {
opt.autoplay = Number(autoplay);
}
... ...