diff --git a/demo/bootstrap.html b/demo/bootstrap.html index d190b99..c0d04ff 100644 --- a/demo/bootstrap.html +++ b/demo/bootstrap.html @@ -38,9 +38,9 @@

Twitter Bootstrap Demo

There is also a bug in IE7 that causes the leftmost column to resize when scrolling. Consider using conditional comments (see source) to make sure the plugin is not loaded in this browser.

- + - + diff --git a/demo/scrollable-div-with-clipping-container.html b/demo/scrollable-div-with-clipping-container.html new file mode 100644 index 0000000..ae1497a --- /dev/null +++ b/demo/scrollable-div-with-clipping-container.html @@ -0,0 +1,1224 @@ + + + + Demo: Using StickyTableHeaders within a scrollable block + + + + +
+

+ Demo: Using StickyTableHeaders within a scrollable block with Clipping container +
+ + +

+
+
+

+ Results - Cycling - Road 2011 +

+

+ Women Elite Championnats du Monde UCI (DEN/CM) +

+
LabelLabel Layout width Column width Gutter width
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Rank + + Name + + Nat. + + Team + + Age + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result + + Result +
+ 1 + + Judith ARNDT + + GER + + + GER + + 35 + + 37:07.38 +
+ 2 + + Linda Melanie VILLUMSEN + + NZL + + + NZL + + 26 + + +21.73 +
+ 3 + + Emma POOLEY + + GBR + + + GBR + + 29 + + +24.13 +
+ 4 + + Tara WHITTEN + + CAN + + + CAN + + 31 + + +26.16 +
+ 5 + + Clara HUGHES + + CAN + + + CAN + + 39 + + +36.79 +
+ 6 + + Eleonora VAN DIJK + + NED + + + NED + + 24 + + +38.88 +
+ 7 + + Rhae-Christie SHAW + + CAN + + + CAN + + 36 + + +39.23 +
+ 8 + + Amber NEBEN + + USA + + + USA + + 36 + + +41.09 +
+ 9 + + Emilia FAHLIN + + SWE + + + SWE + + 23 + + +55.06 +
+ 10 + + Marianne VOS + + NED + + + NED + + 24 + + +55.77 +
+ 11 + + Ina TEUTENBERG + + GER + + + GER + + 37 + + +56.14 +
+ 12 + + Shara GILLOW + + AUS + + + AUS + + 24 + + +1:00.55 +
+ 13 + + Elena TCHALYKH + + AZE + + + AZE + + 37 + + +1:00.84 +
+ 14 + + Emma JOHANSSON + + SWE + + + SWE + + 28 + + +1:01.13 +
+ 15 + + Evelyn STEVENS + + USA + + + USA + + 28 + + +1:21.73 +
+ 16 + + Olga ZABELINSKAYA + + RUS + + + RUS + + 31 + + +1:25.20 +
+ 17 + + Julia SHAW + + GBR + + + GBR + + 46 + + +1:49.88 +
+ 18 + + Noemi CANTELE + + ITA + + + ITA + + 30 + + +1:58.26 +
+ 19 + + Pascale SCHNIDER + + SUI + + + SUI + + 27 + + +1:58.84 +
+ 20 + + Pia SUNDSTEDT + + FIN + + + FIN + + 36 + + +2:01.33 +
+ 21 + + Mélodie LESUEUR + + FRA + + + FRA + + 21 + + +2:04.91 +
+ 22 + + Aleksandra SOSENKO + + LTU + + + LTU + + 20 + + +2:08.82 +
+ 23 + + Olena PAVLUKHINA + + UKR + + + UKR + + 22 + + +2:19.05 +
+ 24 + + Latoya BRULEE + + BEL + + + BEL + + 23 + + +2:29.12 +
+ 25 + + Grete TREIER + + EST + + + EST + + 34 + + +2:33.78 +
+ 26 + + Leire OLABERRIA DORRONSORO + + ESP + + + ESP + + 34 + + +2:42.41 +
+ 27 + + Christel FERRIER-BRUNEAU + + FRA + + + FRA + + 32 + + +2:45.56 +
+ 28 + + Martina SABLIKOVA + + CZE + + + CZE + + 24 + + +2:57.43 +
+ 29 + + Alexandra BURCHENKOVA + + RUS + + + RUS + + 23 + + +3:01.22 +
+ 30 + + Ashleigh MOOLMAN + + RSA + + + RSA + + 26 + + +3:07.52 +
+ 31 + + Taryn HEATHER + + AUS + + + AUS + + 29 + + +3:08.71 +
+ 32 + + Elisa LONGO BORGHINI + + ITA + + + ITA + + 20 + + +3:13.09 +
+ 33 + + Michelle LAUGE JENSEN + + DEN + + + DEN + + 20 + + +3:19.29 +
+ 34 + + Tjaša RUTAR + + SLO + + + SLO + + 27 + + +3:20.45 +
+ 35 + + Eneritz ITURRIAGAECHEVARRIA MAZAGA + + ESP + + + ESP + + 31 + + +3:28.91 +
+ 36 + + Alena AMIALIUSIK + + BLR + + + BLR + + 22 + + +3:29.20 +
+ 37 + + Katarzyna SOSNA + + LTU + + + LTU + + 21 + + +3:33.05 +
+ 38 + + Liesbet DE VOCHT + + BEL + + + BEL + + 32 + + +3:44.95 +
+ 39 + + Valeria MULLER + + ARG + + + ARG + + 37 + + +3:52.77 +
+ 40 + + Nontasin CHANPENG + + THA + + + THA + + 27 + + +3:59.35 +
+ 41 + + Tetyana RIABCHENKO + + UKR + + + UKR + + 22 + + +4:00.58 +
+ 42 + + Verónica LEAL BALDERAS + + MEX + + + MEX + + 34 + + +4:07.34 +
+ 43 + + Alenka NOVAK + + SLO + + + SLO + + 34 + + +4:12.46 +
+ 44 + + Kathryn BERTINE + + SKN + + + SKN + + 36 + + +4:17.64 +
+ 45 + + Monrudee CHAPOOKHAM + + THA + + + THA + + 29 + + +4:21.88 +
+ 46 + + Jacqueline HAHN + + AUT + + + AUT + + 20 + + +4:48.44 +
+ 47 + + Dinah CHAN + + SIN + + + SIN + + 25 + + +4:56.11 +
+ 48 + + Yelena ANTONOVA + + KAZ + + + KAZ + + 40 + + +5:21.82 +
+ 49 + + Martina RUZICKOVA + + CZE + + + CZE + + 31 + + +5:46.28 +
+ 50 + + Seba ALRAAI + + SYR + + + SYR + + 29 + + +9:40.76 +
+ 51 + + Claire FRASER + + GUY + + + GUY + + 33 + + +9:45.43 +
+
+ lots of content down here... +
+ + + + + + diff --git a/js/jquery.stickytableheaders.js b/js/jquery.stickytableheaders.js index 4d742f1..3ad661e 100644 --- a/js/jquery.stickytableheaders.js +++ b/js/jquery.stickytableheaders.js @@ -15,7 +15,11 @@ objWindow: window, scrollableArea: window, cacheHeaderHeight: false, - zIndex: 3 + cacheHeaderWidth: false, + cacheClippingContainerWidth: true, + zIndex: 3, + clippingContainerId: null, + dynamicTopOffset: function() { return 0; } }; function Plugin (el, options) { @@ -36,8 +40,10 @@ base.$clonedHeader = null; base.$originalHeader = null; - // Cache header height for performance reasons + // Cache header height, width and clippingContainer width for performance reasons base.cachedHeaderHeight = null; + base.cachedHeaderWidth = null; + base.cachedClippingContainerWidth = null; // Keep track of state base.isSticky = false; @@ -63,6 +69,7 @@ base.$originalHeader.addClass('tableFloatingHeaderOriginal'); + base.changeClonedHeaderIds(base.$clonedHeader); base.$originalHeader.after(base.$clonedHeader); base.$printStyle = $('