keyup(), change(), events issue on IE8 (load image works only one time)
am front of a problem on IE8. (not tested on IE9)
this is my little programm with some HTML + Jquery
a picture worth a thousand words you can take a view here http://twixtop.lescigales.org/color/
i need five folders A B P C D
actually when you select a "MODEL", the defaults values show in text input form on the left-sidebar "W.png, W.png, W.png, X.png X.png"
// Settings
var settings = {
"model": "DIAM",
"baseColor": "W",
"sideColor": "W",
"ambientColor": "W",
"baseLight": "X",
"centralColor": "X",
"rendureference": "WXY3"
};
var options = {
"imageC": "images/[model]/C/[baseColor].png",
"imageD": "images/[model]/D/[sideColor].png",
"imageA": "images/[model]/A/[ambientColor].png",
"imageB": "images/[model]/B/[baseLight].png",
"imageP": "images/[model]/P/[centralColor].png",
"renduZ": "WXY3-[model]-[ambientColor]-[baseLight]-[centralColor]-[baseColor][sideColor]-TG",
"ValueModel": "[model]"
}
$('#customizer [type="radio"]').bind('click', function() {
var el = $(this);
settings[el.attr('name')] = el.attr('value');
settingDigest();
});
// Show Var
function settingDigest()
{
var imgC = options.imageC;
var imgD = options.imageD;
var imgA = options.imageA;
var imgB = options.imageB;
var imgP = options.imageP;
var renZ = options.renduZ;
var valueM = options.ValueModel;
for(i in settings) {
imgC = imgC.replace('['+i+']', settings[i]);
imgD = imgD.replace('['+i+']', settings[i]);
imgA = imgA.replace('['+i+']', settings[i]);
imgB = imgB.replace('['+i+']', settings[i]);
imgP = imgP.replace('['+i+']', settings[i]);
renZ = renZ.replace('['+i+']', settings[i]);
valueM = valueM.replace('['+i+']', settings[i]);
}
// left sidebar input text keyup
$('#avatar_C').val(imgC).keyup();
$('#avatar_D').val(imgD).keyup();
$('#avatar_A').val(imgA).keyup();
$('#avatar_B').val(imgB).keyup();
$('#avatar_P').val(imgP).keyup();
$('#avatar_Z').val(renZ).keyup();
$('#avatar_JADE').val(valueM).keyup();
}
The problem appears when you select a color repeatedly only on IE8 for example:
- select differents colors in the Base Panel (white, gray, red and one blue)
- back already selected a color (white or gray)
- IE8 does not charge properly image
i think there is a problem of cache ?? memory image ? i don't know ... I try to play with the functions .live(), .bind(), .blur(), .change(), .. no way
already selected a button does not reload the image a second time if it has already been selected in advance...
I started to pull my hair. f.....g internet explorer...
i have try differents things emulate ie8 like an IE7... // no result
All works on CHROME, FIREFOX, IE7, OPERA, SAFARI awesome...
EDIT 20 janv 2011
this is my first post here.. sorry for my poor english...
there is a JSBIN for people want to help me. jsbin.com/ihiyi4/3
- Select a开发者_开发知识库 model (DIAMON or JADE) this load default images
- Select differents colors in the Base Panel (white, gray, red and one blue)
- back already selected a color (white or gray)
- IE8 does not charge properly image
I do not understand why IE8 user's need to empty the cache to load again the image
精彩评论