keyup()、change()、IE8 上的事件问题(加载图像只能运行一次)
我在 IE8 上遇到了一个问题。 (未在 IE9 上测试)
这是我的小程序,其中包含一些 HTML + Jquery
一张价值一千字的图片 你可以在这里查看 http://twixtop.lescigales.org/color/
我需要五个文件夹ABPCD
实际上当您选择“模型”时,默认值显示在左侧栏上的文本输入表单中“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();
}
当您选择一个“模型”时,就会出现问题仅在 IE8 上重复颜色例如:
- 在 基本面板(白色、灰色、红色和一个蓝色)
- 背面已选择一种颜色(白色或灰色)
- IE8 无法正常充电图像
我认为存在缓存问题?记忆图像?我不知道 ... 我尝试使用函数 .live()、.bind()、.blur()、.change()、.. 如果已经提前选择了按钮,那么不可能
已经选择的按钮不会再次重新加载图像......
我开始拉扯我的头发。 F.....g 互联网浏览器...
我尝试过不同的事情 像 IE7 一样模拟 ie8... // 无结果
全部适用于 CHROME、FIREFOX、IE7、OPERA、SAFARI 太棒了...
2011 年 1 月 20 日编辑
这是我在这里发表的第一篇文章.. 抱歉我的英语很差...
有一个 JSBIN 供想要帮助我的人使用。 jsbin.com/ihiyi4/3
- 选择型号(DIAMON 或 JADE),此加载默认图像
- 在基本面板中选择不同的颜色(白色、灰色、红色和一个蓝色)
- 返回已选择的颜色(白色或灰色)
- IE8 无法正常充电图像
我不明白为什么 IE8 用户需要清空缓存才能再次加载图像
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论