JSFiddle - React, Tailwind, and code Playground
by Soul_Master
HTML
<div id="divContainer">
<img src=http://i51.tinypic.com/2cgitmh.png alt="World Icon" />
</div>
CSS
#divContainer
{
background:Purple;
padding:10px;
}
JavaScript
$(function()
{
preloadImages('#divContainer');
$('#divContainer img')
.mouseout(function()
{
$(this).fadeTo(500, 0.25);
})
.mouseover(function()
{
$(this).fadeTo(500, 1);
})
.mouseout();
});
function preloadImages(id) {
var c = new Array();
$(id+' img').each( function(j) {
c[j] = new Image();
c[j].src = this.src;
if ( $.browser.msie ) {
this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='image',src='"+ this.src +"')";
}
});
}