File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ <h1>Sticky Header</h1>
31
31
function buildTable ( $el , cells , rows ) {
32
32
var i , j , row ,
33
33
columns = [ ] ,
34
- data = [ ] ;
34
+ data = [ ] ,
35
+ stickyHeaderOffsetY = 0 ;
35
36
36
37
for ( i = 0 ; i < cells ; i ++ ) {
37
38
columns . push ( {
@@ -47,12 +48,20 @@ <h1>Sticky Header</h1>
47
48
}
48
49
data . push ( row ) ;
49
50
}
51
+
52
+ if ( $ ( '.navbar-fixed-top' ) . css ( 'height' ) ) {
53
+ stickyHeaderOffsetY = + $ ( '.navbar-fixed-top' ) . css ( 'height' ) . replace ( 'px' , '' ) ;
54
+ }
55
+ if ( $ ( '.navbar-fixed-top' ) . css ( 'margin-bottom' ) ) {
56
+ stickyHeaderOffsetY += + $ ( '.navbar-fixed-top' ) . css ( 'margin-bottom' ) . replace ( 'px' , '' ) ;
57
+ }
58
+
50
59
$el . bootstrapTable ( 'destroy' ) . bootstrapTable ( {
51
60
columns : columns ,
52
61
data : data ,
53
62
search : true ,
54
63
stickyHeader : true ,
55
- stickyHeaderOffsetY : + $ ( '.navbar-fixed-top' ) . css ( 'height' ) . replace ( 'px' , '' ) + + $ ( '.navbar-fixed-top' ) . css ( 'margin-bottom' ) . replace ( 'px' , '' ) + 'px'
64
+ stickyHeaderOffsetY : stickyHeaderOffsetY + 'px'
56
65
} ) ;
57
66
}
58
67
</ script >
You can’t perform that action at this time.
0 commit comments