Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Help with javascript and css variables !?!?
I just found out the window height using the window.innerHeight function, stored the variable and processed it to finally get a variable 'finHeight'. Now i need to make it use that variable as a part of a css style, i tried usng this, but it doesn't work.
[code]
document.write('<table style="position: absolute; top: ' + finHeight + ';" align="center" height="768" width="1024" id="table">')
[/code]
I need to position the table at a certain number of pixels, which are calculated dynamically depending on the window's size.
I need help to do this. If there is another way, do feel free to tell me.
And the document.write function writes the line right after it is called i hope, or doesn't it
i.e., in the example, the <table............> will be written after the document.write(.......) or somewhere else ??
Thanks in advance!!
now i think my javascript code isn't getting executed at all.
check it at :
http://khushman1.googlepages.com/gmaps-wtrial.html
the loong javascript at the end is purposely added as a comment for slow bandwitdth's
1 Answer
- 1 decade agoFavorite Answer
Use <body onload="table_center()"> to execute your code.
But that page doesn't render at all in FireFox. Too many HTML errors. The Javacript block should be between the head tags. There is no opening table tag. There is no closing body tag. And you commented out some div tags but not the closing div tags.