fixe image switcher bug on left (delta = -1)
This commit is contained in:
		
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user