![]() Topic awaiting preservation: Setting Float via JS (Page 1 of 1) |
|
|---|---|
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 02-06-2006 19:41
My google-fu is weak today and I can't find an answer to this. code: <script language="javascript">
window.onload = creater;
function creater() {
newElm = document.createElement('div');
var exitLink = document.createElement('a');
// exitLink.style.float = 'right';
exitLink.setAttribute('href','javascript:void(0)');
exitLink.appendChild( document.createTextNode('x') );
exitLink.style.float = 'right';
exitLink.style.padding = '1px';
exitLink.style.fontSize = '8px';
exitLink.style.border = '1px solid #032462';
exitLink.style.display = 'block';
exitLink.style.margin = '2px';
exitLink.style.width = '10px';
exitLink.style.textDecoration = 'none';
exitLink.style.textAlign = 'center';
newElm.style.width ='100px';
newElm.style.backgroundColor = '#ccc';
newElm.appendChild( exitLink );
newElm.appendChild( document.createTextNode('This is a whole bunch of text text') );
document.body.appendChild( newElm );
}
</script>
|
|
Paranoid (IV) Inmate From: Norway |
posted 02-06-2006 21:40
|
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 02-06-2006 22:46
Ah the first didn't work, the setAttribute did however. |
|
Bipolar (III) Inmate From: Umeå, Sweden |
posted 02-07-2006 13:48
Most things that are reserved words in one language are referred to by appending the originating language to it. |
|
Paranoid (IV) Inmate From: schillmania.com |
posted 02-12-2006 19:49
I've found that sometimes setting attributes work (or don't) before/after an append to the document. Kind of wacky. |
|
Nervous Wreck (II) Inmate From: |
posted 02-14-2006 03:28
b |
|
Maniac (V) Mad Scientist From: :morF |
posted 02-14-2006 07:39
c |