Questions tagged [offsetheight]

Height of an element relative to the element's offsetParent.

Syntax and values

var intElemOffsetHeight = document.getElementById(id_attribute_value).offsetHeight;

intElemOffsetHeight is a variable storing an integer corresponding to the offsetHeight pixel value of the element. offsetHeight is a read-only property.

Description

Typically, an element's offsetHeight is a measurement which includes the element borders, the element vertical padding, the element horizontal scrollbar (if present, if rendered) and the element CSS height.

Non-scrollable elements (CSS overflow not set or set to visible) will have equal offsetHeight and scrollHeight (is this right? scrollHeight doesn't include the border, while offsetHeight would include border).

For the document body object, the measurement includes total linear content height instead of the element CSS height. Floated elements extending below other linear content are ignored.

37 questions
0
votes
2 answers

How could one sync the offsetHeight of a section to the current time via new Date?

I'm relatively new to JavaScript and have spent a lot of time with date and time tutorials in the past few weeks, but there is just one thing I simply cannot figure out for my abstract clock project: having the offsetHeight of my div sync to the…
0
votes
0 answers

Why do I get difference in offsetheight and offsetwidth values when I emulate my web application from IE5 to IE7 or higher?

I want to make all the web pages in my web application to be compatible with the latest IE=Edge. Hence, I emulated my application using the IE developers tool and faced with a lot of broken CSS. I understand this is common when we move a web page…
Jerin Nishok
  • 13
  • 1
  • 6
0
votes
2 answers

Div always matching each others even when window/outer div change

I am trying to match the height of each slide based on the highest one. I see that I can use “offsetHeight”, but that is a set of height when the code load. I want to make it fixable when the window/outer div change (I am using flexbox for the…
Yan Mak
  • 151
  • 1
  • 11
0
votes
1 answer

D3 cannot read property offsetHeight of null

I get this cannot read property 'offsetHeight' of null while i just initialized its height. Here is my code: d3.select("#container") .style("height", "100%") .style("width", "100%") .style("position", "relative") .style("bottom",…
Robin van Hoorn
  • 334
  • 1
  • 10
0
votes
1 answer

Dynamically setting height of React rendered table in Firefox differs from Chrome

working on a React project currently, using webpack, webpack-dev-server, hot module reloading, React Router, styled-components etc I have created a Table component where I try to dynamically determine the number of rows to render within the Table…
0
votes
2 answers

Javascript element offsetHeight returns returns 0 in for loop

I am trying to dynamically get the height of a child element inside a three column grid. When i is equal to 2 or when i is greater than 1 (i.e. when there are at minimum 2 elements inside the loop), offsetHeight returns the rendered height correctly…
rainerbrunotte
  • 907
  • 1
  • 17
  • 37
0
votes
0 answers

offsetHeight returns different results in standard mode and quirks mode

Hi I am very new to CSS. I have this simple html page which I render in IE 11 standard mode: New Document
Test1
Shrinath Shetty
  • 305
  • 2
  • 10
0
votes
1 answer

offsetHeight of table row/TR seems to be giving different value in IE11 when standard complaint mode is NOT switched on. Is this bug in IE11?

I have 2 tables with equal number of rows kept side by side to achieve the requirement of fixed first column (1st table at left side) & horizontally scroll-able rest of the columns (2nd table at right side). While onload, based on the content…
0
votes
2 answers

JavaScript - If statement using .offsetHeight not working

I'm new to JavaScript and am practicing. I'm trying to display the combined height of the h1 and p elements that are within the div that has a class name of "test". I've looked up all sorts of stuff and feel like I'm really close, but can't quite…
Bryan
  • 93
  • 2
  • 9
0
votes
1 answer

Html body style "padding-top" not working in Firefox

Why when i'm doing: document.body.style["padding-top"] = panel.offsetHeight + "px"; the "padding-top" is not working in Firefox? It is ok in Chrome & IE , but FF - stab in the back. The whole code is: var fixTopPanel = function(){ var panel =…
Ivan Chernykh
  • 41,617
  • 13
  • 134
  • 146
0
votes
0 answers

How to reset DIV offsetHeight when contained text font is reduced

I have a
that is used to determine the vertical space required by an arbitrary text string. By default, the height of the
box grows to accommodate the text, including wrapped lines, etc. If I increase the font size of the contained text,…
dkretz
  • 37,399
  • 13
  • 80
  • 138
0
votes
1 answer

testing offsetHeight with major

I'm becoming mad with some simple javascript stuff. I need a simple javascript to test the offsetHeight of a table to dinamically set its div container. I can get the correct value in tableHeight , but the "if" conditions do not work.. Here the…
0
votes
0 answers

Javascript offsetleft, offsettop, offsetwidth and offsetheight

Can anyone tell me how Javascript methods "offsetleft", "offsettop", "offsetwidth" and "offsetheight" works in IE? How can we make them work properly in IE? Please tell me a suitable function for the same. Thanks in advance ! This is my…
0
votes
2 answers

how to find real DIV height?

I have the following html structure:

This is an h1 element

When I try to find the height of the container in firefox or chrome div using javascript: var container = document.getElementById("container"); var…
Saar
  • 2,276
  • 1
  • 16
  • 14
0
votes
1 answer

Internet explorer gives total webpage height as "0"

I am trying to get total height of webpage using javascript as follows var pageHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight; works fine for me in other browsers but Internet explorer returns a value '0' for…
Abhishek Umrao
  • 171
  • 1
  • 4
  • 11