jquery perfomance tips
Filed Under (jquery) by admin on 14-12-2011
I have just stumbled on this performance tip so I tried and tested it, so far the results were good there are some speed improvement on my jquery codes.
Optimize selectors for Sizzle’s ‘right to left’ model
As of version 1.3, jQuery has been using the Sizzle Javascript Selector Library which works a bit differently from the selector engine used in the past. Namely it uses a ‘right to left’ model rather than a ‘left to right’. Make sure that your right-most selector is really specific and any selectors on the left are more broad:
var linkContacts = $(‘.contact-links div.side-wrapper’);
instead of:
var linkContacts = $(‘a.contact-links .side-wrapper’);
More tips from this website
http://dumitruglavan.com/jquery-performance-tips-cheat-sheet/


