JSDOC / coding standards createDiv function

git-svn-id: http://svn.openlayers.org/trunk/openlayers@143 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-18 13:11:13 +00:00
parent 312e7cb7a8
commit 90918dad48

View File

@@ -521,47 +521,45 @@ Array.prototype.clear = function() {
/** Create a child element (a div currently) that
* is a proper child of the supplied parent, is invisible,
* positioned as requested within the parent, etc
*
/**
* zIndex is NOT set
*
* @param {str} id - HTML ID of new element, if empty something is made up
* @param {String} id - HTML ID of new element, if empty something is made up
* @param {OpenLayers.Pixel} pt - x,y point if missing 0,0 is used
* @param {OpenLayers.Size} sz - size else size of parent is used
* @param {str} overflow - behavior of clipped/overflow content
* @param {str} img - background image url
* @param {str} position - relative or absolute?
* @param {String} overflow - behavior of clipped/overflow content
* @param {String} img - background image url
* @param {String} position - relative or absolute?
*
* @return {DOM}
* @returns A DOM Div created with the specified attributes.
* @type DOMElement
*/
OpenLayers.Util.createDiv = function(id, pt, sz, overflow, img, position) {
var x,y,w,h;
if (pt){
if (pt) {
x = pt.x;
y = pt.y;
} else {
x = y = 0;
}
if (!position){
if (!position) {
position = "absolute";
}
if (!id){
id = "OpenLayersDiv" + (Math.random()*10000%10000);
if (!id) {
id = "OpenLayersDiv" + (Math.random() * 10000 % 10000);
}
var dom = document.createElement('div');
dom.id = id;
if (overflow){
if (overflow) {
dom.style.overflow = overflow;
}
if (sz) {
dom.style.width = sz.w+"px";
dom.style.height = sz.h+"px";
dom.style.width = sz.w + "px";
dom.style.height = sz.h + "px";
}
dom.style.position = position;
dom.style.top = y;
@@ -570,7 +568,7 @@ OpenLayers.Util.createDiv = function(id, pt, sz, overflow, img, position) {
dom.style.margin = "0";
dom.style.cursor = "inherit";
if (img){
if (img) {
dom.style.backgroundImage = 'url(' + img + ')';
}