Skip to content Skip to sidebar Skip to footer

Is Pixelheight Still Supported In Html5

i am trying to make a rather old javascript work in newer browsers(currently only supports ie6). Well it isn't working and is littered with document.getElementById('idValue').styl

Solution 1:

Short: Don't use it.

Use:

document.getElementById('idValue').style.height = x+'px';

Solution 2:

From what I've been able to glean, pixelHeight was supported by IE6 and Opera 8 and I've not been able to find any documentation about it anywhere doing a quick Google, my javascript books and MDN. Using it must be dangerous ground to be walking on.

EDIT: One thing I did find is that pixelHeight retrieves height so, perhaps changing to that would solve the problem. That site says pixelHeight works in all browsers but Firefox. However, it's obviously non-standard so you shouldn't use it while height is standard.

Solution 3:

I replaced var height = pixelHeight with clientHeight.

and added + "px" onto my calculations.

This seems as standard as I can get it (well, it works on Firefox, Chrome, and IE10 is using completely different code CSS3 and grid based).

Post a Comment for "Is Pixelheight Still Supported In Html5"