SV: SV: Dynamically creating layers in FireFox

"Kenneth Chr. Nilsen" <[email protected]> Thu, 23 Mar 2006 20:24:02 +0100
Newsgroups gmane.comp.web.dom.wdf
Organization Optisoft
Message-ID <002601c64eaf$57bc4f40$0a01a8c0@winhell>
Bugger... that solved everything! :)
Many thanks Scott (and to you others for helpful suggestions)!

mvh / regards, 
Kenneth Chr. Nilsen


> -----Opprinnelig melding-----
> Fra: [email protected] [mailto:[email protected]] 
> På vegne av Scott Sauyet
> Sendt: 23. mars 2006 20:17
> Til: [email protected]
> Emne: Re: SV: [wdf-dom] Dynamically creating layers in FireFox
> 
> 
> Kenneth Chr. Nilsen wrote:
> > The HTML consist only of plain HTML and a couple of DIVs.
> > I use a test button to check:
> 
> You don't have units on your dimensions.  Try
> 
>           newDiv.style.left = x + 'px';
>           newDiv.style.top = y + 'px';
>           newDiv.style.width = w + 'px';
>           newDiv.style.height = h + 'px';
> 
> That should do it.  Everything else looks okay.
> 
>    -- Scott
> 
> 
> > ---
> > <a href="#" onclick="createLayer('layDialog', 'layTesting', 70, 70, 
> > 400, 300, 100);return false" id="btnCreateLayer">Create layer</a>
> > ---
> > 
> > The function is in it's own .js file. Works as I mentioned 
> with IE and 
> > Opera, not fault during debugging. In FF nothing happends. 
> Here is the 
> > function that I use:
> > 
> > ---
> > function createLayer(parentID, layID, x, y, w, h, zIndex)
> > {
> >     if (document.document.getElementById)      //disabling 
> this check makes
> > no difference in FF.
> >     {
> >         pElement = document.getElementById(parentID);
> >         var newDiv = document.createElement("DIV");
> > 
> >         newDiv.setAttribute('id',layID);
> >         newDiv.setAttribute('name',layID);
> >         newDiv.style.left = x;
> >         newDiv.style.top = y;
> >         newDiv.style.width = w;
> >         newDiv.style.height = h;
> >         newDiv.style.position = 'absolute';
> >         newDiv.style.visibility = 'visible';
> >         newDiv.style.zIndex = zIndex;
> >         newDiv.style.backgroundColor = "#aaaaaa";
> >         pElement.appendChild(newDiv);
> >     }
> >     else ...
> >     {
> >         ...
> >     }
> > }
> 
> 
> 
> Unsubscribe
> [email protected]
> 
> List info
> http://www.quirksmode.org/dom/list.html 
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 



Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/