diff --git a/heatcalc/heatcalc.js b/heatcalc/heatcalc.js index d021260..5d7d2da 100644 --- a/heatcalc/heatcalc.js +++ b/heatcalc/heatcalc.js @@ -63,6 +63,12 @@ define(["jquery"], function ($) { }; function check_scroll(){ + // + $("#hc_table thead.table").find('tr').first().children().each(function(i, e){ + $($("#hc_table thead.fixed").find('tr').children()[i]).width($(e).width()); + }); + + // make sure the left/right buttons are hidden if already at far left/right var sl=$("#table_container").scrollLeft(); var sl_max = $("#hc_table").outerWidth() - $("#table_container").width(); @@ -188,12 +194,10 @@ function draw_table(){ // display the table $("#table_container").append(table); - //clon the thead + //clone the thead var org_thead=$("#hc_table thead"); - org_thead.clone().attr('id','floater').css('position','fixed').prependTo("#hc_table"); - org_thead.find('tr').first().children().each(function(i, e){ - $($("#hc_table thead#floater").find('tr').children()[i]).width($(e).width()); - }); + org_thead.clone().attr('class','fixed').css('position','fixed').prependTo("#hc_table"); + org_thead.attr('class','table'); //enable highlighting $("#hc_table td").on("mouseover", function() {