Summary of interface knowledge for generating floating layer

Source: Internet
Author: User

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 ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.