Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why couldn't the Netscape layer show the content correctly?

Status
Not open for further replies.

JasonXie

Programmer
Feb 4, 2001
20
0
0
NZ
I tried to use layer to load an external file.
I would like the position of the layer be relative rather than absolute.
So, I used javascript to create the layer and put the javascript in a cell of a table.
I hope the layer can be shown in the right way and it can load the external file.
However, the content of the external file only could be shown partly.
the difinition about the layer is the below:

document.write('<div id=&quot;Discription&quot; style=&quot;position:relative;width:390; height:340;z-index:100; background-image: url(Src/layerbg.jpg);layer-background-image: url(Src/layerbg.jpg); border:0px &quot; ></div>');

I tried to change relative to absolute, and added top and left attribution. The external file could be shown correctly. But why it didn't work with position:relative ?

The example you can find is and
please help, please give me an idea to fix the relative position bug.

Thank you very much.
 
i think you can only have a src for absolutely positioned (layers) elements. hmmm, maybe try changing the positioning via script after the file loads in it to relative.

Oh yeah and, ditch NS4.X jared@aauser.com -
 
NS6...

X-) &quot;When God gives you lemons, make lemonade!”
 
Hi,Jaredn:

I am trying to change the position dynamically by Javascript.
However, I have got another problem that is how to get the details about the screen resolution by script. The resolution is the main element for calculating the position dynamically.
Can you give me a clue ?
Thank you very much.

 
Hi, Jaredn:

I have got the method to know the client's resolution. Pretty easy after looking throgh
the book.

Just call screen.width and screen.height. That is all.

Thank you very much.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top