Hi i am having black and white images on my website on mouse hover need to change the image immediately.But it is taking time to change the image for the first time later on it is changing the images immediately.
Code:
<div id="content">
<img src="<?php echo base_url();?>theme/images/expertise/1.png" class="images1" onmouseover="this.src='<?php echo base_url();?>theme/images/1.png'" onmouseout="this.src='<?php echo base_url();?>theme/images/expertise/1.png'" />
<img src="<?php echo base_url();?>theme/images/expertise/2.png" class="images2" onmouseover="this.src='<?php echo base_url();?>theme/images/2.png'" onmouseout="this.src='<?php echo base_url();?>theme/images/expertise/2.png'"/>
</div>
Css
#content {
margin-top: 21px;
margin-bottom: 57px;
}
.images1,.images2 {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-property: transform;
transition-property: transform;
}
.images1:hover,
.images1:focus,
.images1:active,
.images2:hover,
.images2:focus,
.images2:active
{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}