473,396 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Progressively slower IE performance

I'm looking for an answer or solution to a problem that I'm having with
javascript + DOM code.. The code modifies table rows with a color on
hover (since :hover doesn't work in IE except on link blocks/inlines)
... It's fine when the table is 50 rows or so, but in reaching numbers
towards 180, IE visually slows down *a ton*, and I don't know if this
is a known issue with no fix, but I can't seem to find any good
documentation about it other than people complaining about it. Below is
the code that is used for the events. I'm aware of better ways to
adding/removing classes, but for this particular page's case, no other
classes need to be preserved on hover. Any help is appreciated.

(just a quicky table, repeat <tr> block as needed)

<table id="listTable">
<tbody>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
</tbody>
</table>

....and the script, not called with window.onload(), just after the
table is finished printing out in the browser.

function trHover() {
var table = document.getElementById('listTable');
var Tbodies = table.getElementsByTagName('tbody');
for (var i=0; i<Tbodies.length; i++) {
var tBodyRows = Tbodies[i].getElementsByTagName('tr');
for (var j=0; j<tBodyRows.length; j++) {
tBodyRows[j].oldClass = tBodyRows[j].className;
tBodyRows[j].onmouseover = function() {
this.className = "row-on";
}
tBodyRows[j].onmouseout = function() {
this.className = this.oldClass;
}
}
}
}
trHover();

Jun 1 '06 #1
1 1144
VK
rchristie81 wrote:
...and the script, not called with window.onload(), just after the
table is finished printing out in the browser.

function trHover() {
var table = document.getElementById('listTable');
var Tbodies = table.getElementsByTagName('tbody');
for (var i=0; i<Tbodies.length; i++) {

<snip>

Holly Grail!

1. This goes to the head section (or add to your stylesheet):

<style type="text/css">
td {
behavior: url(hover.htc);
}
</style>
2. hover.htc file:
<?xml version="1.0"?>
<public>
<component>
<attach event="onmouseover" onevent="highlight()" />
<attach event="onmouseout" onevent="restore()" />
</component>
<script type="text/Jscript"><!--

function highlight() {
element.style.backgroundColor = '#DDDDDD';
}
function restore() {
element.style.backgroundColor = '#FFFFFF';
}

//--></script>

</public>

Note: Bindings are getting refactored events for the bound element
only: so you don't have to worry if the event came from the cell itself
or from some underlaying element.

I tried it in 200 row tables without any visible problems (sorry for
not posting HTML code :-)

Jun 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Gustavo L. Fabro | last post by:
Greetings! Getting straight to the point, here are the results of my experiment. I've included my comments and questions after them. The timing: (The total time means the sum of each line's...
0
by: Mike O. | last post by:
MS Access 2003 "filter by form" has drop down lists that allow the user to select values for each field to filter by. However, once some values are selected,the remaining dropdown lists remain the...
17
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html Why is C# 500% slower than C++ on Nested Loops ??? Will this problem be solved in...
14
by: Roy Gourgi | last post by:
Hi, How much is C# slower than C++? TIA Roy
87
by: John Rivers | last post by:
Hello everybody, I just wondered if anybody else has noticed this? It takes around 6 seconds to start debugging a very simple ASPX page with VS.NET whereas VB6 takes under 0.5 seconds, even...
4
by: dhnriverside | last post by:
Hi peeps I'm having some problems with my Session State sticking (it keeps resetting itself) - I haven't looked into it yet, but I was wondering about using SQL Server as an out of process state...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
3
by: ommail | last post by:
Hi I wonder if regular expressions are in general sower than using classes like String and Char when used for validating/parsing text data? I've done some simple test (using IsMatch()) method...
11
by: ThunderMusic | last post by:
Hi, I have a windows service that only loads a CSV file and import it's data using SqlBulkCopy in a newly created Sql Server 2005 table using 25000 rows batches. If I build the service in debug...
9
by: Ryan Liu | last post by:
Hi, I use C# wrote an Client/Server application. In production environment, will be 130 clients (Windows XP) connect to a Server (Windows 2000/2003 Server) thought TCP/IP socket in a local 100M...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.