bug fix white img from right on cards on ff

This commit is contained in:
Bachir Soussi Chiadmi 2021-08-05 10:59:11 +02:00
parent 34b3823649
commit ee60bb2255
4 changed files with 7 additions and 7 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

@ -29,16 +29,16 @@ export default {
// switch images on mousemove
el.addEventListener('mousemove', function (event) {
const figs = this.querySelectorAll('figure.loaded')
// console.log('mousemove', this, event, figs.length)
console.log('mousemove', this, event, figs.length)
// let len = figs.length
// let w = this.clientWidth;
// let g = w / len;
// let delta = Math.floor(event.layerX / g)
let delta = Math.floor(event.layerX / (this.clientWidth / figs.length))
delta = delta < 0 ? 0 : delta
// console.log('delta', delta)
delta = delta < 0 ? 0 : delta >= figs.length ? figs.length - 1 : delta
console.log('delta', delta)
figs.forEach((fig, index) => {
// console.log(index)
console.log(index)
if (index === delta) {
// fig.style.display = "block"
fig.classList.remove('hide')