This is a problem I'm having in Chrome. It does not happen in Firefox. I will provide CSS, HTML, and Jquery Examples at the bottom.
The problem: When I hover over a PNG (which happens to be in a carousel jquery plugin right now), a hover image replaces the initial PNG. It even happens when I drag an element with Jquery's drag and drop functionality. It works without any problems, but the background slightly shifts or becomes distorted for just a second when it happens. It's not a great user experience, and I was wondering if someone knew how to fix it. Let me know what code you need to look at.
Code Examples
HTML:
<li id="img-home"><img id="img-home-src" src="<?php echo base_url();?>files/assets/images/homepage/img.png" alt="" /></li>
CSS:
li {
text-align: center;
cursor: pointer;
}
#img-home
{
border:0;
width:386px;
height:484px;
overflow:hidden;
display: inline-block;
padding: 0 0 0 0;
margin: 0 0 0 0;
}
#img-home-src
{
padding: 0 0 0 0;
margin: 0 0 0 0;border:0;
}
Jquery:
$("#img-home").hover(
function () {
$("#img-home-src").attr("src","<?php echo base_url();?>files/assets/images/homepage/img_hover.png");
},
function () {
$("#img-home-src").attr("src","<?php echo base_url();?>files/assets/images/homepage/img.png");
}
);