Reputation: 1722
I have some jquery that runs like nothing in chrome but IE keeps choking on it. I have a table with some static columns that are static by absolute positioning. I want to make sure they expand vertically with their parent row, so I have this code to expand them. It works, but it takes FOREVER in IE. What can I change to improve performance in IE?
$("#grdSchedule tr").each(function(i){
$(this).find(".stickyCol").height($(this).height());
});
EDIT: .height() is the problem
This is what I have tried so far but it hasnt helped much at all.
var stickyCols = GetStickyColumnCount();
$("#grdSchedule > tbody > tr").each(function(i) {
thisRow = $(this);
thisRow.children().slice(0, stickyCols).height(thisRow.height());
//thisRow.children(".stickyCol").height(thisRow.height());
});
It seems that calling height() every time is whats dragging it down in IE. I am going to make a new question for maybe some css help so i dont need to run this script in the first place. But if anyone can add anything for speeding this up in IE it would be awesome!!
in case anyone is wondering, for my big ugly grid of production data, chrome is running this in like 2.5 seconds, where IE takes like 20 seconds.
I think maybe I should try and address this with css and not javascript
Upvotes: 0
Views: 172
Reputation: 148140
Try this,
$("#grdSchedule tr .stickyCol").height(function(i,height){
return $(this).closest('tr').height();
});
Upvotes: 1