smooth scrolling to featured thumb
This commit is contained in:
parent
40cf497c5e
commit
05fd4e9792
|
@ -29,7 +29,11 @@ export default {
|
|||
},
|
||||
|
||||
mounted () {
|
||||
this.$refs.galleries[this.galleryActive].scrollIntoView({behavior: 'smooth'})
|
||||
// cannot just use this.galleryActive as if we do and it is the last element
|
||||
// chrome (at least?) pushes body up and creates wierd gap at bottom of body
|
||||
// to get round this we will just scroll to the second last element in this case
|
||||
const index = this.galleryActive >= this.galleries.length - 1 ? this.galleryActive - 1 : this.galleryActive
|
||||
this.$refs.galleries[index].scrollIntoView({behavior: 'smooth'})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue