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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with write() writeln() on several browsers

Status
Not open for further replies.

silverdeath

Programmer
Nov 5, 2005
3
ES
I dinamically created a text string, which is:

imStr = "<DIV ID=elBGim STYLE='position:absolute;left:0;top:106;height:100%;z-index:-2'><IMG NAME='imBG' BORDER=0 SRC=images/background.gif WIDTH=781 HEIGHT=1003></DIV>"

but when viewing in firefox or Netscape (it works in ie) this div and its within image won`t appear either with document.write() or document.writeln(). why might this be? a little erlier in the same function I wrote another line and it worked.

any hints to solve this?
 
hints:

show the code that you're using. like, more of it than what you've shown. you're not even showing your document.write call.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

BillyRayPreachersSonIsTheLeetestHax0rDude
[banghead]
 
>[tt]z-index:-2[/tt]
Change it to non-negative number to show.
 
thanks BillyRayPreachersSon and specially tsuji, the z-index set to 0 made it work. it was a CSS incompatibility problem, rather than a programming one.
 
dan, which is the problem with my code?

it *was* a CSS compatibility problem, since it solved when setting the z-index to a non-negative number.

the only code once having the given variable value was
writeln(imStr);
 
At the end of the day, it's all a matter of perspective / opinion, so don't worry too much about it.

But to explain what I meant anyway ;o)... the CSS you gave was your code, and as the problem lay in your CSS code, then I think it quite reasonable to say that the problem was a programming one.

To say it was a CSS incompatibility issue really implies that the fault was in the use of the negative number - whereas it was not. Using negative z-indexes is perfectly acceptable, even in Firefox, if you understand how they work WRT z-indexes on other elements around them (including the body).

Hope this clarifies what I meant,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top