We often have to generate floating layers when we do application development, which shows us what we need to display. This writes an interface that generates a floating layer. As follows:
JS Code
function Minimizeexec (Floatlyrcomm) {
var execobjcnt = $ (floatlyrcomm+ "Cnt");
var Execobjdiv = $ (Floatlyrcomm);
var eventelement = Event.srcelement | | Event.target;
if (execobjcnt.style.display== ') {
ExecObjCnt.style.display = ' None ';
Eventelement.innertext = "-";
ExecObjDiv.style.height = ' 20px ';
}else if (execobjcnt.style.display== ' none ') {
ExecObjCnt.style.display = ';
Eventelement.innertext = "-";
}
}
/*************************************************************************************/
/*
/* Document Append Class (currently used to generate floating layer)
/*
/*************************************************************************************/
function Docwritegen () {
}
docwritegen.prototype={
/**
* Purpose: Generate floating Layer
* AUTHOR:LIUGX
* Remark:
*/
Genfloatlyr:function (Floatlyrid,floatlyrpro) {
var floatdiv = document.createelement ("div");
Floatdiv.id = Floatlyrid;
Floatdiv.classname = "Float-lyr";
Floatdiv.style.position = "absolute";
Floatdiv.style.left = floatlyrpro.left?floatlyrpro.left: "0px";
Floatdiv.style.left = floatlyrpro.left| | " 0px ";
Floatdiv.style.top = floatlyrpro.top| | " 0px ";
Floatdiv.style.width = floatlyrpro.width| | " 200px ";
Floatdiv.style.height = floatlyrpro.height| | " 100px ";
if (floatlyrpro.opacity) {
floatdiv.style.opacity = floatlyrpro.opacity;
Floatdiv.style.filter = ' alpha (opacity= ' + parseint (parsefloat (floatlyrpro.opacity) *100) + ') ';
}
Floatdiv.style.borderColor = floatlyrpro.bordercolor| | " #6495ED ";
Floatdiv.style.display = ' None ';
Trcolor = floatlyrpro.trcolor| | " #6495ED ";
Tdtitle = floatlyrpro.tdtitle| | "";
floatdiv.innerhtml = ' <table width= "100%" height= "100%" boder= "0" cellspacing= "0" cellpadding= "0" > ' +
' <tr style= ' background-color: ' + trcolor + ' > ' +
"<td height=" width= "96%" style= "color: #FFFFFF" onmouseover= "this.style.cursor=\ ' hand\ ';" +
' Onmousedown= ' Element.move (document.getElementById (\ ' +floatdiv.id+ '), event); " > ' +tdtitle+ ' </td> ' +
' <td width= ' 2% "style=" color: #FFFFFF; Cursor:hand "onclick=" minimizeexec (\ ' +floatdiv.id+ ') ">-</td>" +
' <td width= ' 2% ' style= ' color: #FFFFFF; Cursor:hand "onclick=" document.getElementById (\ ' +floatdiv.id+ '). Style.display=\ ' none\ ' >x</td> ' +
' </tr> ' +
' <tr> ' +
' <td colspan= ' 3 "valign=" Top "><div id=" ' +floatdiv.id+ ' Cnt ' ></div></td> ' +
' </tr> ' +
' </table> ';
return floatdiv;
}
}
var Docwritegen = new Docwritegen ();