Wednesday, May 25, 2011

Problem with getting height of element

Hi,

I am currently working on my own implementation of scrollable panel because I want to have opportunity to customize style of scrollbar but I encountered some problem. I want to hide scrollbar when it is not needed. Idea is simple. I listen for LoadEvent fired by content of this panel and when I received it I compare height of content with height of wrapping panel. If content has height grater than wrapper, I hide scrollbar but here emerges my problem. I need opportunity to define height of wrapper in css in percentage. In this case when I check height of wrapper after receiving LoadEvent it's always 0px thus scrollbar is always visible even if it is not needed. Of course after rendering wrapper has height computed accordingly to percentage value and it's not 0px. I tried to get height of this wrapper by js function getComputedStyle() but it didn't work, it still returns 0px. Maybe someone has other idea how I can hide this scrollbar or get computed height of this wrapper?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment