Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] CSS in JS function - where is the error?
- From: javascript@xxxxxxxxxx (Andrzej Wroblewski)
- Subject: [Javascript] CSS in JS function - where is the error?
- Date: Tue, 28 Jan 2003 18:43:11 +0100
Hi,
Look at this function and tell me what is wrong:
<HTML>
<HEAD>
<script TYPE="text/javascript">
function pozBaner() {
var odLewa=document.body.clientWidth;
var banerleft = odLewa - 500 +"px"
alert(banerleft);
//variable banerleft equals for example 511px so why baner.gif is
not moved 511px to the left??
// when I type for example 511px instead of "+banerleft+" (in
line below) everythnig is ok
document.write('<div style="position:absolute;
left:"+banerleft+";">');
document.write('<img SRC="baner.gif">');
document.write('</DIV>');
}
</SCRIPT>
</HEAD>
<BODY>
<script TYPE="text/javascript">
pozBaner();
</SCRIPT>
</BODY>
</HTML>
Where I made a mistake?
Thanks for any help.
Greetings
andrzej w.
------------------------------------
e-mail: alfwro@xxxxx
http://republika.pl/wroblewski_online
- Follow-Ups:
- [Javascript] CSS in JS function - where is the error?
- From: Ben Joyce
- [Javascript] CSS in JS function - where is the error?
- From: Peter Brunone
- [Javascript] CSS in JS function - where is the error?
- From: Hassan Schroeder
- [Javascript] CSS in JS function - where is the error?
- Prev by Date: [Javascript] FORM validation question
- Next by Date: [Javascript] CSS in JS function - where is the error?
- Previous by thread: [Javascript] Selektiflah dalam Berbisnis
- Next by thread: [Javascript] CSS in JS function - where is the error?
- Index(es):