From e055c2f0896dcb44453ea5bdd74f6d56308da9e2 Mon Sep 17 00:00:00 2001 From: lcoln <875482941@qq.com> Date: Tue, 26 Sep 2017 00:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F=E7=94=B1:a?= =?UTF-8?q?ttr=E6=8C=87=E4=BB=A4=E6=94=B9=E4=B8=BA:css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/lib/sliders/main.htm | 3 +-- js/lib/sliders/main.js | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/lib/sliders/main.htm b/js/lib/sliders/main.htm index 8d69a22..9542da7 100644 --- a/js/lib/sliders/main.htm +++ b/js/lib/sliders/main.htm @@ -4,14 +4,13 @@
+ :css="{width: sliderList.length * 100 + '%', transform: transform}">

diff --git a/js/lib/sliders/main.js b/js/lib/sliders/main.js index 39f2df4..418f088 100644 --- a/js/lib/sliders/main.js +++ b/js/lib/sliders/main.js @@ -95,7 +95,7 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){ if(vm.currWidth.indexOf('px') > -1) width = vm.currWidth.slice(0, vm.currWidth.indexOf('px')) - vm.transform = 'transform: translate(' + (-width * val) + 'px, 0);' + vm.transform = 'translate(' + (-width * val) + 'px, 0)' if(vm.preview) vm.sliderBtnList = getBtnList(vm) }) @@ -106,7 +106,7 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){ if(vm.currWidth.indexOf('px') > -1) width = vm.currWidth.slice(0, vm.currWidth.indexOf('px')) - vm.transform = 'transform: translate(' + (-width * vm.curr) + 'px, 0);' + vm.transform = 'translate(' + (-width * vm.curr) + 'px, 0)' if(vm.preview) vm.sliderBtnList = getBtnList(vm) }, false) @@ -125,8 +125,8 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){ transform: '', curr: 0, sliderBtnList: [], - maxNum: '', - auto: '', + maxNum: 0, + auto: yua.noop, sliderList: [], autoSlide: '',