kinda hard to explain, but let me try:
I’d like to put a table inside a container . this container has a fixed height, say 500px, and the table is rather long, say 2100 and each row’s height can be different.
When the table is created, all the rows are invisible, now I want to do a calculation based on container’s height to find out how many rows should appear inside the container. it could be first 15 rows, or first 17 rows (because some row’s height is bigger).
After I do that, I let those rows stay there for some time, and hide them again, and do another calculation to fetch next page, and so on… Now the hard part it how do I do the calculation using jquery?
You can get the heights computed by the browser by using
jQuery.innerHeightandjQuery.outerHeightfunctions. So you can first get the computed height of the container. Then you can iterate through rows and add their computed height until the sum is bigger than the container’s computed height and so on..Hope this helps.