InnerHeight () conflicting with chrome?

CSS code:

#jpspm { position: relative; top: -83px; left: -1px; padding-top: 3px; padding-bottom: 3px; padding-left: 64px; padding-right: 63px; width: 563px; z-index: 1; display: block; } 

JQuery Code:

 var jp_con = jQuery('#jpspm').innerHeight(); console.log('InnerHeight:' + jp_con); 

Example: http://jsfiddle.net/xzexn/

it works fine in firefox and explorer, but in Chrome it makes a difference, help will be appreciated.

+4
source share
1 answer

The innerHeight client can vary greatly. While jensgram did a great job of commenting, I got 26 in Chrome and 6 in Firefox.

Keep in mind that innerHeight also not a reliable cross browser and is not as widely used as clientHeight . From dottoro :

The innerHeight property is rarely useful because scrollbars are not part of the workspace of a document. Use the cross-browser clientHeight property of the html element. It returns the height of the browser without a horizontal scrollbar.

+1
source

Source: https://habr.com/ru/post/1388297/


All Articles