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
>$(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!!!");
>
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 sna
David,
I'm not sure how coincidential life could be, but i just began working
on the same icon set last night.
Although its not relevant to jquery, you can see a HUGE optimisation
boost using css sprites. This will get all 1,000 icons within view in
about 1-2 seconds (as opposed to several m
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 perfec
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 on
David Singleton ha scritto:
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 mak
7 matches
Mail list logo