Opened 14 years ago
Closed 14 years ago
#4154 closed bug (invalid)
Firefox 3 + a lot of (mouseover) events
Reported by: | fmate14 | Owned by: | brandon |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | event | Version: | 1.3.1 |
Keywords: | mouseover firefox | Cc: | |
Blocked by: | Blocking: |
Description
I try use $('td').mouseover(fn) with a lot of td's. But I can not refresh or leave the page on Firefox 3.0.6, it begins thinking, and thinking, then I must kill the jQuery script.
For example see the attachement file! Sorry the hungarian strings, but just load it into FF 3 and try reload. It thinking a lot before it begins re-loading.
As I see this is maybe because jQuery want unbind the events. But it works well with IE or Opera.
Currently I wrote onmouseover attribute to every <td> (not use jQuery event binding), and it works with FF too.
Attachments (2)
Change History (6)
comment:1 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 Changed 14 years ago by
I should add that I tried it on a slow XP system with only 384MB RAM, so if there was a problem I'm pretty sure it would show up on this system.
Changed 14 years ago by
Attachment: | minimal_test.zip added |
---|
Minimal test for jQuery 1.3.1 and Firefox 3.0.6
comment:3 Changed 14 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Dear dmethvin!
I'm in shame. The teszt.zip attachement was wrong, because I send the file I don't want.
I have created a minimal test. It is only 74kb html file. It contains 4,000 <em> tag. With jQuery's mouseover and mouseout events it can not be reloaded with Firefox 3.0.6 (it can be reloaded with IE, Opera, etc), but it works well with HTML's onmouseover and onmouseout events.
Yes, I know 4,000 event is a lot, but in my current work I must use like this. If I must, I can use HTML's events, but as you see, the HTML file will bigger.
Thank you for your works and sorry my english.
comment:4 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Your English is good, and your new test case is better!
Instead of attaching two handlers for every event, try the jQuery 1.3 event delegation:
$('em').live("mouseover", function(){ $(this).css('background', '#f00') } ); $('em').live("mouseout", function(){ $(this).css('background', '#fff') } );
This worked well with your test case and was very fast. I don't think this is a bug, you just need to be careful about attaching a lot of event handlers.
I tried this with jQuery 1.3.1 and Firefox 3.0.6 and performance is very good, especially considering it's a 1.3MB HTML file! I don't see any long delays on reload.