hi
i want to get height of a div with document.gtElementById('divid').offsetHeight in javascript. it works well in firefox but in IE it returns 0.
what is the solution?
i guess maybe the offsetHeight doesn't work in IE ,but
document.body.offsewtHeight
return a number bigger than 0 ! altought it is different from what firefox returns.
fumnimda 0 Junior Poster in Training
Recommended Answers
Jump to Postfunction findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (1) { curleft+=obj.offsetLeft; if (!obj.offsetParent) { break; } obj=obj.offsetParent; } } else if (obj.x) { curleft+=obj.x; } return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (1) { curtop+=obj.offsetTop; if (!obj.offsetParent) …
All 2 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.