Window中的dhtmlxColorPicker 颜色选择器控件在弹出时被覆盖的原因是:
dhtmlxColorPicker 的z-index 值比Window窗口的z-index 小。
解决方法:在初始话dhtmlxColorPicker时设置z-index 大于window的z-index
在dhtmlxcolorpicker.js中添加新方法:setZindex
初始化dhtmlxColorPicker 控件的方法如下:
[size=small]
[color=red]关键代码:
获得window的z-index 和设置颜色选择器的z-index[/color][/size]
dhtmlxColorPicker 的z-index 值比Window窗口的z-index 小。
解决方法:在初始话dhtmlxColorPicker时设置z-index 大于window的z-index
在dhtmlxcolorpicker.js中添加新方法:setZindex
dhtmlXColorPicker.prototype.setZindex = function(zIndex)
{
this.container.style.zIndex=zIndex;
}
初始化dhtmlxColorPicker 控件的方法如下:
//初始化颜色选择器
var myCP1 = new dhtmlXColorPickerInput('dhtmlxreplaceColor');
myCP1.setImagePath("/webmaster/dhtmlxColorPicker/codebase/imgs/");
myCP1.setOnSelectHandler(function (color) {
//some code
//alert(color);
});
var zIndex = index.adGroupWin.getEl().dom.style.zIndex;
alert(zIndex)
myCP1.setZindex(parseInt(zIndex)+1);
myCP1.init();
[size=small]
[color=red]关键代码:
获得window的z-index 和设置颜色选择器的z-index[/color][/size]
var zIndex = index.adGroupWin.getEl().dom.style.zIndex;
myCP1.setZindex(parseInt(zIndex)+1);