• Just updated to 4.4 and img-mouseover isn’t working any longer. It appears that with the transition to provide responsive images all images are loaded with “srcset” in addition to “src”. Browsers that support the srcset attribute (Firefox and Chrome) will ignore the src attribute. Since img-mouseover ONLY changes src and not srcset as well this renders the plugin useless.

    I tried examining the JS code to fix the issue but it is just beyond my reach. Is there any chance in getting this resolved?

    For anyone else out there using this plugin. If you want it to continue to work avoid upgrading to 4.4.

    https://www.ads-software.com/plugins/img-mouseover/

Viewing 1 replies (of 1 total)
  • Thread Starter eprowe

    (@eprowe)

    I decided to take a deeper dive and came up with a REALLY bad hacky fix. I started by copying the source of img-mouseover.js to Notepad++. Did this so I can share specific line numbers.

    First change I made was following line 84 which reads:
    this.outSrc = this.src;

    I added the following:
    this.outSrcSet = this.srcset;

    This caches the original srcset values.

    Next we need to modify the mouseover and mouseout functions. They are located on approximately lines 88 and 99.

    In mouseover look for the line this.src = this.overImg.src; and follow it with this.srcset = this.overImg.src;

    In mouseout look for the line this.src = this.outSrc; and follow it with this.srcset = this.outSrcSet;

    You could also try to update the click function in a similar fashion. Following the line this.src = this.clickImg.src; with this.srcset = this.clickImg.src;

    Once again this is very hacky, but will return the basic mouseover functionality.

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress 4.4 Compatibility’ is closed to new replies.