Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #13805

Appending a TABLE to a DIV

From "Richard Maher" <maher_rj@hotspamnotmail.com>
Newsgroups comp.lang.javascript
Subject Appending a TABLE to a DIV
Date 2012-05-06 18:42 +0800
Organization HTTP *is* The Box - Let's think outside
Message-ID <jo5kjb$mf8$1@speranza.aioe.org> (permalink)

Show all headers | View raw


Hi,

Can someone please tell me why, in the code below, can I see the table when 
I append it to the document.body but not the DIV(wire)?

That is: -
         wire.appendChild(decal);       // shows a ghost of the table
         document.body.appendChild(decal);  // shows the whole table

Cheers Richard Maher

<html>
<head>
    <script language="javascript">
function load(){
     var flyScreen = function() {
         var OPACITY = 25;
         var wire = document.createElement('div');
         wire.style.visibility='visible';
         wire.style.position='absolute';
         wire.style.top='0px';
         wire.style.left='0px';
         wire.style.overflow='hidden';
         wire.style.opacity=(OPACITY / 100);
         wire.style.MozOpacity=(OPACITY / 100);
         wire.style.filter='alpha(opacity='+OPACITY+')';
         wire.style.zIndex=998;
         wire.style.backgroundColor='#000000';
         wire.style.width='100%';
         wire.style.height='100%';

         var delayMsg = "Loading";
         var decal = document.createElement("table");
//         decal.style.visibility='visible';
         decal.border="1";
         decal.style.color="blue";
//         decal.style.zindex=999;
         decal.style.position='absolute';
         decal.style.top='0px';
         decal.style.left='0px';
         var decalLine,
             decalChar;
         for (var i=0;i<delayMsg.length;i++){
             decalLine = decal.insertRow(-1);
             decalChar = decalLine.insertCell(-1);
             charText  = document.createTextNode(delayMsg.substr(i,1));
//              decalChar.style.zindex=9999;
             decalChar.appendChild(charText);
//             decalLine.style.zIndex=1000;

         }

         wire.appendChild(decal);
//         document.body.appendChild(decal);
         document.body.appendChild(wire);

         var open = function(){
             return function(){
                 wire.style.visibility='hidden';
             }
         }();

         var close = function(){
             return function() {
                 wire.style.visibility='visible';
             }
         }();

         return {
                close  : close,
                open   : open
                };
     }();
}
</script>
<body onload="load()">
Some stuff
</body>
</html>


Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Appending a TABLE to a DIV "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-05-06 18:42 +0800
  Re: Appending a TABLE to a DIV Mr Ruaraidh Petrie <me@sorry_no_spam> - 2012-05-06 18:29 +0100
    Re: Appending a TABLE to a DIV "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-05-07 05:55 +0800
      Re: Appending a TABLE to a DIV Mr Ruaraidh Petrie <me@sorry_no_spam> - 2012-05-10 21:29 +0100
  Re: Appending a TABLE to a DIV "Richard Cornford" <Richard@litotes.demon.co.uk> - 2012-05-06 20:08 +0100
    Re: Appending a TABLE to a DIV "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-05-07 06:00 +0800
      Re: Appending a TABLE to a DIV "Richard Cornford" <Richard@litotes.demon.co.uk> - 2012-05-07 13:52 +0100
        Re: Appending a TABLE to a DIV "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-05-07 21:31 +0800
          Re: Appending a TABLE to a DIV "Richard Cornford" <Richard@litotes.demon.co.uk> - 2012-05-07 19:58 +0100
    Re: Appending a TABLE to a DIV Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-07 21:57 +0200
  Re: Appending a TABLE to a DIV Andrew Poulos <ap_prog@hotmail.com> - 2012-05-07 13:41 +1000
  Re: Appending a TABLE to a DIV "Leonardo Azpurua" <leonardo@exmvps.org> - 2012-05-07 08:17 -0430
    Re: Appending a TABLE to a DIV "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-05-07 21:34 +0800

csiph-web