修改样式由:attr指令改为:css
parent
a597117368
commit
e055c2f089
|
@ -4,14 +4,13 @@
|
|||
|
||||
<div class="container">
|
||||
<div class="box"
|
||||
:attr="{style: 'width:' + sliderList.length * 100 + '%;' + transform}">
|
||||
:css="{width: sliderList.length * 100 + '%', transform: transform}">
|
||||
<a target="_blank"
|
||||
:repeat="sliderList"
|
||||
:css="{width: currWidth}"
|
||||
:attr="{href: el.link || 'javascript:;'}">
|
||||
<img :attr-src="el.src">
|
||||
<p :if="el.title"
|
||||
:attr="{style: el.titlaStyle ? el.titleStyle + ';' : ''}"
|
||||
:html="el.title"
|
||||
class="default-class"></p>
|
||||
</a>
|
||||
|
|
|
@ -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: '',
|
||||
|
|
Reference in New Issue