[jQuery] Re: A demo and an optimization question

2007-05-29 Thread Dan G. Switzer, II
David, I've been using jquery to build an icon picker for FAMFAMFAM's Silk icon set. I've got a working version (at http://dsingleton.co.uk/code/icon- selector/), but with 1000 images on the page everything is a little slow, i'm wondering what I can do to optomize the JS make it a little

[jQuery] Re: A demo and an optimization question

2007-05-29 Thread Dan G. Switzer, II
$(document).bind(click, function (e){ // get the target element (srcElement for IE, originalTarget for W3C) var el = e.srcElement || e.originalTarget; if( el.tagName == A el.className == icon ){ alert(Hey, I'm an a.icon element!!!); return

[jQuery] Re: A demo and an optimization question

2007-05-29 Thread Jörn Zaefferer
Dan G. Switzer, II wrote: $(document).bind(click, function (e){ // get the target element (srcElement for IE, originalTarget for W3C) var el = e.srcElement || e.originalTarget; if( el.tagName == A el.className == icon ){ alert(Hey, I'm an a.icon

[jQuery] Re: A demo and an optimization question

2007-05-27 Thread Sean Catchpole
I think the problem is not the javascript, but instead the browser. Trying to change the display of a thousand items can cause it to be a little slow. I present to you a small example, that shows javascript can handle many items at once, and since the browser only has to display a few items at

[jQuery] Re: A demo and an optimization question

2007-05-27 Thread David Singleton
Thanks for the tips. Always using element.class in selectors makes sense, I should make it a habbit rather than being lazy. I understand about the idea of ID for a unique instance and classes for repeated types, but this was thrown together rather quickly as a demo, so the semantics aren't