473,804 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

offsetHeight not working in Firefox

16 New Member
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 6152
acoder
16,027 Recognized Expert Moderator MVP
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
12820
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 someone explain to me what is going on? I would like to be able to both predict the offsetHeight for various fontSizes and be able to reduce the offsetHeight. Thanks,
3
2097
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 browser. Anyone seen this problem or have any ideas why this might be occurring ?? (I have web.config browsercaps updated from http://slingfive.com/ ) code: =========
6
14468
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 postback code, but I have a workaround for that installed (and it looks like the code generated by ASP.NET when it renders the page does the same thing, namely, setting document<). However, the problem still exists under firefox. Has anyone come...
3
4688
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 causing this that i'm not taking into consideration? padding/borders?
1
5264
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 fine in Firefox . can any one help me with this
2
4002
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 (getElementById), and set the height of the corresponding cell in the other frame. Here: window.parent.frames.document.getElementById('r2').style.height=(document.getElementById('r2'i).offsetHeight) + 'px'; Everything works perfectly, cell gets...
2
4072
dmjpro
by: dmjpro | last post by:
Have a look at my JavaScript code... function resizeFrameToFitScreen(){ var outerFrameSet = window.parent.document.getElementById('outerFrameSet'); alert(parent.document.body.offsetHeight); alert(document.body.offsetHeight); var top_frame_percentage = Math.round((100/parent.document.body.offsetHeight)*(document.body.offsetHeight+40)); outerFrameSet.rows =...
4
13555
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"> <table id="dtls_TAB" border=0 cellpadding="2" cellspacing="2" width=100%> <tr> <td nowrap id="dtls_TD" class="searchbgcolor" style="background-color:#DDEEEE">Not Available<BR/></td> <td align="right"...
0
9715
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.