![]() |
Performance problem with onMouseover in Internet Explorer
If I open a big table in Internet Explorer the onMouseover event gets
quite slow. When you move the mouse the change of the colors of the rows is quite slow. Here's an example: Please copy the line '<tr class = "stil_normal" onMouseover ...' circa 10'000 times. ================================================== =========== <html> <head> <style type="text/css"> tr.stil_normal { background-color: #ffffbb; } tr.stil_mouseover { background-color: #ffdd55; } </style> </head> <body> <table width = "100%" border = "0" align = "center"> <tr class = "stil_normal" onMouseover = "className = 'stil_mouseover'" onMouseout = "className = 'stil_normal'"><th>TEST</ tn></tr> ... <tr class = "stil_normal" onMouseover = "className = 'stil_mouseover'" onMouseout = "className = 'stil_normal'"><th>TEST</ tn></tr> </table> </body> </html> ================================================== =========== If you have a table with more columns then already a couple of hundred lines is enough to see this effect. In Opera it's a little bit faster and in Mozilla you don't see any performance problems. Do I have to live with it or is there a solution to prevent this performance problem? |
Re: Performance problem with onMouseover in Internet Explorer
buzzard wrote:
> Stefan Mueller wrote: >> If I open a big table in Internet Explorer the onMouseover event gets >> quite slow. When you move the mouse the change of the colors of the >> rows is quite slow. >> >> Here's an example: >> Please copy the line '<tr class = "stil_normal" onMouseover ...' circa >> 10'000 times. <snip> >> ================================================== =========== >> >> If you have a table with more columns then already a couple of hundred >> lines is enough to see this effect. >> In Opera it's a little bit faster and in Mozilla you don't see any >> performance problems. >> >> Do I have to live with it or is there a solution to prevent this >> performance problem? > > > > I don't know if this will perform better or not, > but it has less code, and still appears to work: > (disclaimer: i only tested it on ff. but u'c'n try > it out on IE and see) > > > <html> > <head> > <style type="text/css"> > tr.stil { > background-color: #ffffbb; > } > > tr.stil:hover { > background-color: #ffdd55; <snip> If you don't trigger quirks mode :hover pseudo-classes will work on non-link elements in IE7+ IE6 and less will need JavaScript assistance, and yes, IE is no sprinter when it comes to JavaScript. -- Take care, Jonathan ------------------- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com |
ie onmouseover slow
i had a problem that sounded similar. to check if it is the same problem try this:
1. browse to your web page using ie 2. with the page still up disconnect your computer from the internet 3. do your onmouseover stuff for me, only the preloaded onmouseover images appeared; and now the the solution might seem obvious. i had only precached my onmouseover images. for some reason telling ie to precache the onmouseover images was like telling it not to cache anything else. wtf!? only ie had the problem; there were no problems either way with;
<head> <script type="text/javascript"> image1 = new Image();</script> </head> here is a prototype of the page, now working:
byron wu and kerry [quayle] wyer learn to read with help from soundlearning.com.au |
| All times are GMT. The time now is 01:28 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.