$(window).load(function() {
var paircount = 0;
var $thisSprite = $("#%id% img.imageStyle");
if ($.browser.msie)
{
// I need this only if desaturate png with aplha channel
$thisSprite = $thisSprite.desaturateImgFix();
}
// modified not to desaturate the clone
$thisSprite.each(function(){
$(this).addClass("%id%")
.clone()
.attr('id', '')
.addClass('color')
.hide()
.insertAfter($(this))
});
// desaturate all occourances
$thisSprite = $thisSprite.desaturate();
// Need to remove this instance of the desaturated origonal below on hover
// currently shows both on hover...???????????
// add events for switch between color/gray versions
$('.centered_image').bind('mouseenter mouseleave', function(e){
$(this).find('img').toggle().toggleClass('color');
});
});
New test at http://www.doobox.co.uk/test/test.html
Kind regards
Gary.