473,416 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

offsetHeight not working in Firefox

16
offsetHeight is not working in following code

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function Coverdiv()
  3. {
  4.     var standard=(document.compatMode=="CSS1Compat") ? document.documentElement:document.body;
  5.     var dv = document.createElement("div");
  6.     dv.setAttribute("id","cover");
  7.     document.body.appendChild(dv);
  8.     var cover=document.getElementById("cover");
  9.     //dv.innerHTML="Samit";
  10.     cover.style.top=0+"%";
  11.     cover.style.left=0+"%";
  12.     cover.style.backgroundColor="#000000";
  13.     cover.style.zIndex=100;
  14.     cover.style.height=100+"%";
  15.     cover.style.position="absolute";
  16.  
  17.     cover.style.width=100+"%";
  18.     cover.style.height=document.body.offsetHeight;
  19.     cover.style.opacity="0.8";
  20.  
  21.     var contDiv=document.createElement("div");
  22.     contDiv.setAttribute("id","Contents");
  23.     document.body.appendChild(contDiv);
  24.     var Content=document.getElementById("Contents");
  25.  
  26.     Content.innerHTML="Samit";
  27.     Content.style.top=50+"%";
  28.     Content.style.left=50+"%";
  29.     Content.style.backgroundColor="#FFFFFF";
  30.     Content.style.zIndex=101;
  31.     Content.style.height=20+"%";
  32.     Content.style.width=20+"%"
  33.     Content.style.position="absolute";
  34. };
  35. window.onload=Coverdiv;
  36. </script>
Jul 1 '09 #1
1 6131
acoder
16,027 Expert Mod 8TB
What do you expect it to be and what is it instead? Perhaps you should be using the greater of scrollHeight/offsetHeight.
Jul 1 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: arkerpay2001 | last post by:
Layout Gurus, My program has divs that contain a single text node. I programatically set the myDiv.style.fontSize = "8pt"; When I call myDiv.offsetHeight, the number "14" is returned. Can...
3
by: TJS | last post by:
I am finding that the serverside requiredvalidator doesn't fire in the firefox browser, and user request proceeds through to my updateProfile method. Validation is working correctly in the IE...
6
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the...
3
by: marchaos | last post by:
I'm retreiving the offsetHeight of an element in firefox and IE, but in some circumstances, the height is bigger in IE that what it is in firefox, causing problems. Is there something that could be...
1
by: bensamuel | last post by:
hi .. I am using java scritp to generate rowws and columns for a table dynamically, but the offsetWidth and offsetHeigth methods return "0" for the dynamically created elements in IE6 .it works...
2
by: laszlokenez | last post by:
Tested in IE7 and FF2. I have 2 frames, 2 similar tables in them, similar CSS. (I have 1px cellpadding, and 1px border aroud the cells. From one frame I read the offsetHeight of a cell...
2
dmjpro
by: dmjpro | last post by:
Have a look at my JavaScript code... function resizeFrameToFitScreen(){ var outerFrameSet = window.parent.document.getElementById('outerFrameSet'); ...
4
dmjpro
by: dmjpro | last post by:
HTML code <div id="dtls_DIV" style="background-color:#CCCCCC;border-style:solid;border-width:1px;border-color:#000000;display:none;position:absolute;height:180px;width:230px;overflow:auto"> ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.