Morris Peters

+ Follow
since Oct 09, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Morris Peters

Note that for the above, doBottomScroller() and doRightScroller() should be called:
* on page loaded (sets up CSS offsets)
* if table width is changed
* if header or footer row height is changed
* if containing div width/height is changed

The inner scroll bar divs width/height also need to be set up properly - currently they are hardcoded to match the table width/height.

Basically the above example solves all the hard problems, but it needs some love to polish it off.
Here is another method that has frozen/fixed top & bottom rows, and frozen left and right columns.

Unlike the above solution, it does not dynamically alter the CSS, because I think that technique is likely to be unreliable. It also doesn't need the scrollbar mouseover hack which is a definite improvement.

The new code is fast in IE, and fast enough in Firefox and Safari (tested with 50 rows and 15 columns).

There is no jitter, and like the previous solution it uses NO IE expression: in the CSS (expressions cause serious unobvious lag problems; especially with big dynamically generated pages when you use :hover psuedo-attributes in IE7)

I hope this is useful.

This is a hard coded example that freezes the left column, and also the right hand column!

One problem is that in IE there is a bug that changing a CSS rule interrupts the scrollbar dragging. This code has a workaround for that bug - it simulates scrollbar dragging using the mousemove event.