Please help!
我有创建少量窗口的功能。我为每个窗口设置了z-index。但当一些窗口得到关注时,它的z-index变化!如何禁用此功能? !!!!!
function createwindow(obj,objtype,x,y) {
var jsobj = obj;
v_obj[obj_count] = obj;
obj_count = obj_count + 1;
var wnd = $("#" + obj);
wnd.kendoWindow({
width: "150px",
height: "150px",
minWidth: "30px",
minHeight: "2px",
draggable: true,
dragend: SaveWinAttrs,
dragstart: onDragStart
});
$("#" + obj).parent().find(".k-window-action").css("visibility", "hidden");
if (objtype == 'wh') {
$("#" + obj).parent().find(".k-window-titlebar").css('backgroundColor','#fe2712');
$("#" + obj).closest(".k-widget.k-window").css('height', '100px');
$("#" + obj).closest(".k-widget.k-window").css('width', '100px');
$("#" + obj).closest(".k-widget.k-window").css('z-index', '11000');
}
$('.k-window-titlebar').css('height', '2px');
$("#" + obj).parent().find("k-window-content,.k-content").css("padding", "0");
$("#" + obj).parent().find(".k-header").css('min-height', '2px');
$("#" + obj).parent().find(".k-header").css('height', '2px');
//$("#" + obj).closest(".k-window").css({ top: x, left: y });
}
答案 0 :(得分:1)
解决。
我创建了windows对象和数组
var winArray = [];
var winObject = new Object();
winObject.nr = obj;
winObject.color = $("#" + obj).parent().find(".k-window-titlebar").css("backgroundColor");
winObject.x = $("#" + obj).closest(".k-widget.k-window").css("left");
winObject.y = $("#" + obj).closest(".k-widget.k-window").css("top");
winObject.h = $("#" + obj).closest(".k-widget.k-window").css("height");
winObject.w = $("#" + obj).closest(".k-widget.k-window").css("width");
winObject.z = $("#" + obj).closest(".k-widget.k-window").css("z-index");
winArray.push(winObject);
比拖动结束事件恢复z-index保存到对象。
function onDragEnd(e) {
if (winArray.length > 0) {
for (var i = 0; i < winArray.length; i++) {
$("#" + winArray[i].nr).closest(".k-widget.k-window").css('z-index', winArray[i].z);
}
}
}