1 2 3 4 5 6 7 8 9 10 | // Attaching events if (items[0].addEventListener) { for (var i = items.length; i--; ) { items[i].addEventListener('click', e_onclick, false); } } else if (items[0].attachEvent) { for (var i = items.length; i--; ) { items[i].attachEvent('onclick', e_onclick); } } |
Look also on brilliant idea in one of last slide of Dan Webb’s presentation here:
http://www.danwebb.net/2007/11/22/media-ajax
btw. thx for the link to Low Pro :-)
]]>ps. OpenID не отработал
1 | Fatal error: Call to undefined function curl_init() in /var/www/kpumuk/kpumuk.info/wp-content/plugins/openid/openid-classes.php on line 229 |
I mean, for example, it’s far better to attach ONE “mouseover” event to a whole “tbody” and capture the “td” source which fired it than to attach many of “mouseover”s to ALL “td”s…
So, for speed reasons it is crucial “where” do you attach your events…
]]>Dmitrij Štefljuk píše velmi zajímavý seriál o optimalizaci JavaScriptu. Doporučuji všem, co se zabývají JavaScriptem.
…
]]>