2011年6月30日 星期四

[jQuery] use .filter(':visible') to replace $('#id:visible')

Sometimes we will use

$('div:visible') // Does not use querySelectorAll()

to select something is visible, but it dose not utilize querySelectorAll()

so we can use

$('div').filter(':visible') // Uses it

to get high performance

See Also

http://tutorialzine.com/2011/06/15-powerful-jquery-tips-and-tricks-for-developers/
Related Posts Plugin for WordPress, Blogger...