修改样式由:attr指令改为:css
parent
a597117368
commit
e055c2f089
|
@ -4,14 +4,13 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="box"
|
<div class="box"
|
||||||
:attr="{style: 'width:' + sliderList.length * 100 + '%;' + transform}">
|
:css="{width: sliderList.length * 100 + '%', transform: transform}">
|
||||||
<a target="_blank"
|
<a target="_blank"
|
||||||
:repeat="sliderList"
|
:repeat="sliderList"
|
||||||
:css="{width: currWidth}"
|
:css="{width: currWidth}"
|
||||||
:attr="{href: el.link || 'javascript:;'}">
|
:attr="{href: el.link || 'javascript:;'}">
|
||||||
<img :attr-src="el.src">
|
<img :attr-src="el.src">
|
||||||
<p :if="el.title"
|
<p :if="el.title"
|
||||||
:attr="{style: el.titlaStyle ? el.titleStyle + ';' : ''}"
|
|
||||||
:html="el.title"
|
:html="el.title"
|
||||||
class="default-class"></p>
|
class="default-class"></p>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -95,7 +95,7 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){
|
||||||
if(vm.currWidth.indexOf('px') > -1)
|
if(vm.currWidth.indexOf('px') > -1)
|
||||||
width = vm.currWidth.slice(0, vm.currWidth.indexOf('px'))
|
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)
|
if(vm.preview)
|
||||||
vm.sliderBtnList = getBtnList(vm)
|
vm.sliderBtnList = getBtnList(vm)
|
||||||
})
|
})
|
||||||
|
@ -106,7 +106,7 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){
|
||||||
if(vm.currWidth.indexOf('px') > -1)
|
if(vm.currWidth.indexOf('px') > -1)
|
||||||
width = vm.currWidth.slice(0, vm.currWidth.indexOf('px'))
|
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)
|
if(vm.preview)
|
||||||
vm.sliderBtnList = getBtnList(vm)
|
vm.sliderBtnList = getBtnList(vm)
|
||||||
}, false)
|
}, false)
|
||||||
|
@ -125,8 +125,8 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){
|
||||||
transform: '',
|
transform: '',
|
||||||
curr: 0,
|
curr: 0,
|
||||||
sliderBtnList: [],
|
sliderBtnList: [],
|
||||||
maxNum: '',
|
maxNum: 0,
|
||||||
auto: '',
|
auto: yua.noop,
|
||||||
|
|
||||||
sliderList: [],
|
sliderList: [],
|
||||||
autoSlide: '',
|
autoSlide: '',
|
||||||
|
|
Reference in New Issue