Create a div with all of the properties.

Javascript Add comments

function createDiv(obj){
            var gen = document.createElement("div");
                gen.id = obj.id;
                gen.style.top = obj.top + "px";
                gen.style.left = obj.left + "px";
                gen.style.width = obj.width + "px";
                gen.style.height = obj.height + "px";
                gen.style.position = "absolute";
                gen.style.pointerEvents = "none";
                if(obj.bkg) gen.style.background = obj.bkg;
                if(obj.parent) obj.parent.appendChild(gen);
            return gen;
        }

Leave a Reply

visit my other website here >> noeone
Entries RSS Comments RSS Log in