Link ::
The following code is specifically designed for a slider and functions correctly in Firefox, but encounters issues in Chrome (showing a white flash on mouseover and mouseleave) and IE (taking too long to load initially when hovering). Can anyone assist me with this?
<script type="text/javascript>
jQuery(".slides li").each(function(){
var oldurl = jQuery(this).css('background-image');
var imageUrl = jQuery(this).find('.bw_img').html();
jQuery(this).css('background-image', 'url(' + imageUrl + ')');
jQuery(this).find('.bw_img').html(oldurl);
}).mouseenter(function(){
var oldurl = jQuery(this).css('background-image');
var imageUrl = jQuery(this).find('.bw_img').html();
jQuery(this).css('background-image', imageUrl);
jQuery(this).find('.bw_img').html(oldurl);
}).mouseleave(function() {
var oldurl = jQuery(this).css('background-image');
var imageUrl = jQuery(this).find('.bw_img').html();
jQuery(this).css('background-image', imageUrl);
jQuery(this).find('.bw_img').html(oldurl);
});
</script>
(I am aiming for a transition effect where the image turns from black-and-white to colored on mouseover)