[U] set carouselState to active on next/prev
This commit is contained in:
parent
cbc2d22f48
commit
367b4029d4
1 changed files with 2 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ new Vue({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
next: function () {
|
next: function () {
|
||||||
|
this.carouselActive = true;
|
||||||
clearTimeout(this.timeout);
|
clearTimeout(this.timeout);
|
||||||
setTimeout(() => this.carousel(), this.carouselTimeout*2);
|
setTimeout(() => this.carousel(), this.carouselTimeout*2);
|
||||||
if (this.index + 1 < this.files.length) {
|
if (this.index + 1 < this.files.length) {
|
||||||
|
|
@ -18,6 +19,7 @@ new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
prev: function () {
|
prev: function () {
|
||||||
|
this.carouselActive = true;
|
||||||
clearTimeout(this.timeout);
|
clearTimeout(this.timeout);
|
||||||
setTimeout(() => this.carousel(), this.carouselTimeout*2);
|
setTimeout(() => this.carousel(), this.carouselTimeout*2);
|
||||||
if (this.index - 1 >= 0) {
|
if (this.index - 1 >= 0) {
|
||||||
|
|
@ -44,7 +46,6 @@ new Vue({
|
||||||
if (this.carouselActive) {
|
if (this.carouselActive) {
|
||||||
this.carouselActive = false;
|
this.carouselActive = false;
|
||||||
clearTimeout(this.timeout);
|
clearTimeout(this.timeout);
|
||||||
console.log(this.timeout)
|
|
||||||
} else {
|
} else {
|
||||||
this.carouselActive = true;
|
this.carouselActive = true;
|
||||||
this.carousel();
|
this.carousel();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue