function first(Objs) {
var imgid= Objs;
secondMethod(imgid);
}
function secondmethod(imgid) {
var boxid=imgid.id;
var color = getBackgroundColor(imgid.status);//am passing different colors for every refreshing(i.e. #D03C78 or #B8B8B8) values from DataBase
if($('#boxcontent'+boxid).is(':visible')) {
}else{
var boxText = document.createElement("div");
boxText.id='boxcontent'+boxid;
boxText.style.cssText = "white-space:nowrap;text-align:center;border:2px solid ;background-color:"+color+";opacity:0.9;filter:alpha(opacity=90);-moz-border-radius: 5px;border-radius: 5px;color:black !important;";
return boxText;
}
$('#boxcontent'+boxid).css({'background-color':color});
}
- 此框内容显示在 map 上。
- 这个框的背景颜色在 IE 中不可用,但在 FireFox 中可用,
- 第一个函数每 10 秒刷新一次不同的对象。(对于每次刷新变化的颜色)。
- 在 IE 中不工作(即颜色不变),请帮助解决这个问题。
最佳答案
- 检查它是否每 10 秒刷新一次。
- 你说过每 10 秒会得到不同的对象。
- IE 可能会遇到重新发送数据(刷新时)的问题,即缓存问题。
var color = getBackgroundColor(imgid.status);//我为数据库中的每个刷新值(即#D03C78 或#B8B8B8)传递不同的颜色
alert(imgid.id+": color is : "+color)
- 让我们在 Firefox 和 IE 中检查一下这个。
关于javascript - 如何在IE中处理倍数时间功能刷新的框背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23287889/