fixe image switcher bug on left (delta = -1)

This commit is contained in:
Bachir Soussi Chiadmi 2021-08-05 00:18:26 +02:00
parent 63d13e1d88
commit 34b3823649
4 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,8 @@ export default {
// let w = this.clientWidth;
// let g = w / len;
// let delta = Math.floor(event.layerX / g)
const delta = Math.floor(event.layerX / (this.clientWidth / figs.length))
let delta = Math.floor(event.layerX / (this.clientWidth / figs.length))
delta = delta < 0 ? 0 : delta
// console.log('delta', delta)
figs.forEach((fig, index) => {
// console.log(index)
@ -61,7 +62,7 @@ export default {
},
updated () {
// lazy load images on mouseover
console.log('card mounted', this.$options.name)
console.log('card updated', this.$options.name)
// if (this.$options.name ==! 'ModalCard') {
this.activateLazyLoad()
// }
@ -73,7 +74,7 @@ export default {
this.$el.addEventListener('mouseover', function (event) {
const figures = this.querySelectorAll('.images figure.lazy:not(.loaded):not(.loading)')
// console.log('mousemove', this, imgs)
console.log('mouseover', this, figures)
figures.forEach((figure, index) => {
const img = figure.querySelector('img:not(.blank)')
// console.log('forEach img',img)