[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-08 Thread az
Thanks for the explanation, Karl. That makes a lot of sense. Your chunking solution does seem to prevent the unresponsive script errors when the page is loading. However, I still get them when I navigate away from the page -- I assume jquery is unbinding all of the cluetips. For that reason

[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-02 Thread az
Thanks to both Karls for your help! I'll definitely try out the chunking method. Since I'd like to understand what I'm implementing, can you briefly explain why this way is better? thanks, az On Apr 1, 4:59 pm, Karl Rudd [EMAIL PROTECTED] wrote: You can initialise the tips in chunks.

[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-02 Thread Karl Rudd
JavaScript in browsers is single-threaded (and thank goodness for that). So when JavaScript is running (in most browsers) everything else is queuing up. When you break the code into chunks, via setTimeout, you are (essentially) yielding control back to the main event loop periodically, so it has

[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-01 Thread Karl Swedberg
Hi az, The only way I know of to deal with binding events to that many elements directly without incurring huge costs (unresponsive script errors, etc.) is to do it inline, as you suggested. Another approach is event delegation, but I haven't set up the plugin to take advantage of that

[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-01 Thread Karl Rudd
You can initialise the tips in chunks. Instead of doing something like this: $('a.tip').cluetip(); Do something like this: $('a.tip').each(function() { var t = $(this); setTimeout( function() { t.cluetip(); }, 10 ); }) You'll still have a bit of a CPU usage spike but it shouldn't

[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-01 Thread Karl Swedberg
Ah, great idea! thanks, Karl --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 1, 2008, at 7:59 PM, Karl Rudd wrote: You can initialise the tips in chunks. Instead of doing something like this: $('a.tip').cluetip(); Do something like this: