SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Write Layer Problems -- ??

    I am trying to write into a css layer...
    It's working in all browsers except netscape 4

    It has something to do with the bottom else if statement..that's the one for Netscape browsers.

    my code
    Code:
    function writeTotal(layerID,txt) {
    	if(document.getElementById){
    		document.getElementById(layerID).innerHTML=txt;
    	}else if(document.all){
    		document.all[layerID].innerHTML=txt;
    	}else if(document.layers){
    		with(document.layers[layerID].document){
    			open();
    			write(txt);
    			close();
    		}
    	}
    }

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi meztec,

    What the problem is cannot be told from the code you posted. However, I will wager a guess that you are attempting to write to a relatively placed div -- no can do. You can only write to position:absolute divs. If you absolutely need the relativity -- embed an absolute layer within an ilayer

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm currently using <div id="total"> </div>


    That's placed in my code exactly where I want it to write out to.
    But your saying I can't do this?

    I can't position this absolutely since it's a center aligned site and the absolute position could change.

    I don't understand the layer/ilayer method...

  4. #4
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    I cover it some in my tutorial:

    http://www.pageresource.com/dhtml/ryan

    Also, you could do absolute position and change the coordinates depending on the user's screen size with javascript.

    aDog


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •