[jQuery] Re: optimization in jquery

2008-03-06 Thread Gordon
Without any specifics there's no way of saying. What are you trying to do, what does your code look like, and what does your HTML look like? On Mar 6, 2:45 am, Jean-Sébastien [EMAIL PROTECTED] wrote: hi, when i work on a big div tag (containing lots of others elements) browser freeze, during

[jQuery] Re: optimization in jquery

2008-03-06 Thread h0tzen
// store selector-results in variables and reuse $sel = $('.foo-class') $sel.click $sel.find('.bar') $sel.somePlugin // specify selectors as hard as possible $('body div.foo div.bar a.foobar') is more specific and significantly faster than $('a.foobar') // use the scope

[jQuery] Re: optimization in jquery

2008-03-06 Thread Ariel Flesler
Hi H0tzen I disagree with you, I think 'a.foobar' is usually faster than your first selector. It's always relative, because you might have hundreds of a. Then you should first filter most out specifying a container, and then do the straight filter. Each part of the selector requires jQuery to

[jQuery] Re: optimization in jquery

2008-03-06 Thread Jean-Sébastien
hi, in my case the element is selected with an i id, so i guess it's found relatively quickly. but this div is about 800 html lines (doesn't mean anything but i can't count tags). In fact i just made some ajax pagination inside the div. On Mar 6, 3:00 pm, Ariel Flesler [EMAIL PROTECTED] wrote: