Commit 07fc88b5ae9b1c811720fd264562b8bc8f312f5d
1 parent
c4542a56
车流量section
Showing
1 changed file
with
1 additions
and
3 deletions
src/views/newssection.vue
| @@ -47,14 +47,11 @@ export default { | @@ -47,14 +47,11 @@ export default { | ||
| 47 | }, | 47 | }, |
| 48 | methods: { | 48 | methods: { |
| 49 | scroll() { | 49 | scroll() { |
| 50 | - let con1 = this.$refs.rollul; | ||
| 51 | - con1[0].style.marginTop = '30px'; | ||
| 52 | this.animate = !this.animate; | 50 | this.animate = !this.animate; |
| 53 | var that = this; // 在异步函数中会出现this的偏移问题,此处一定要先保存好this的指向 | 51 | var that = this; // 在异步函数中会出现this的偏移问题,此处一定要先保存好this的指向 |
| 54 | setTimeout(function () { | 52 | setTimeout(function () { |
| 55 | that.list.push(that.list[0]); | 53 | that.list.push(that.list[0]); |
| 56 | that.list.shift(); | 54 | that.list.shift(); |
| 57 | - con1[0].style.marginTop = '0px'; | ||
| 58 | that.animate = !that.animate; // 这个地方如果不把animate 取反会出现消息回滚的现象,此时把ul 元素的过渡属性取消掉就可以完美实现无缝滚动的效果了 | 55 | that.animate = !that.animate; // 这个地方如果不把animate 取反会出现消息回滚的现象,此时把ul 元素的过渡属性取消掉就可以完美实现无缝滚动的效果了 |
| 59 | }, 0) | 56 | }, 0) |
| 60 | } | 57 | } |
| @@ -70,6 +67,7 @@ export default { | @@ -70,6 +67,7 @@ export default { | ||
| 70 | height: 26px; | 67 | height: 26px; |
| 71 | background-image: url($img); | 68 | background-image: url($img); |
| 72 | background-repeat:no-repeat ; | 69 | background-repeat:no-repeat ; |
| 70 | + background-position: center center ; | ||
| 73 | } | 71 | } |
| 74 | .nwwest-roll { | 72 | .nwwest-roll { |
| 75 | width: 100%; | 73 | width: 100%; |