keyup()、change()、IE8 上的事件问题(加载图像只能运行一次)

发布于 2024-10-12 10:57:55 字数 2806 浏览 6 评论 0原文

我在 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 上重复颜色例如:

  1. 在 基本面板(白色、灰色、红色和一个蓝色)
  2. 背面已选择一种颜色(白色或灰色)
  3. IE8 无法正常充电图像

我认为存在缓存问题?记忆图像?我不知道 ... 我尝试使用函数 .live()、.bind()、.blur()、.change()、.. 如果已经提前选择了按钮,那么不可能

已经选择的按钮不会再次重新加载图像......

我开始拉扯我的头发。 F.....g 互联网浏览器...

我尝试过不同的事情 像 IE7 一样模拟 ie8... // 无结果

全部适用于 CHROME、FIREFOX、IE7、OPERA、SAFARI 太棒了...

2011 年 1 月 20 日编辑

这是我在这里发表的第一篇文章.. 抱歉我的英语很差...

有一个 JSBIN 供想要帮助我的人使用。 jsbin.com/ihiyi4/3

  1. 选择型号(DIAMON 或 JADE),此加载默认图像
  2. 在基本面板中选择不同的颜色(白色、灰色、红色和一个蓝色)
  3. 返回已选择的颜色(白色或灰色)
  4. 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:

  1. select differents colors in the
    Base Panel (white, gray, red and one blue)
  2. back already selected a color (white or gray)
  3. 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

  1. Select a model (DIAMON or JADE) this load default images
  2. Select differents colors in the Base Panel (white, gray, red and one blue)
  3. back already selected a color (white or gray)
  4. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文