I have static HTML content. I need to format it using multiple columns, which are then displayed as pages for the user. I am using something rather simple, which boils down to the following:
bodyID = document.getElementsByTagName('body')[0];
bodyID.style.width = desiredWidth;
totalHeight = bodyID.offsetHeight;
pageCount = Math.ceil(totalHeight/desiredHeight);
bodyID.style.width = desiredWidth*pageCount;
bodyID.style.height = desiredHeight;
bodyID.style.webkitColumnGap = 0;
bodyID.style.webkitColumnCount = pageCount;
Now my problem is that webKit reads the height attribute as it should and can create more columns than requested if the content does not fit into the number of columns pageCount.
I need to get the number of columns for the proper implementation of paging. However, the value is document.getElementsByTagName('body')[0].style.webkitColumnCountno different from pageCount, even if there are more columns.
Any ideas how to get the total number of columns displayed?
Thanks in advance.