When would I want to use Slick and when would I want to use Sizzle? What are the pros and cons of each as a standalone CSS selector engine? How easily can Slick be used with JQuery? Can Sizzle be used with Mootools?
Class selector is the most useful common selector used by the developers. You can define the class selector using period (.) followed by the class name. It gives styling to all elements with a specified class attribute.
popupbutton is the fastest.
Advantages of Using CSS Selector It's faster than XPath. It's much easier to learn and implement. You have a high chance of finding your elements. It's compatible with most browsers to date.
In terms of performance, css is better and faster, while xpath is on a slower side. An xpath can be of two types – absolute which starts from the root node and relative does not require to be started from the root. To traverse to the nth element, we have to mention [n] in the xpath, where n is the index number.
http://davidwalsh.name/mootools-sizzle - using mootools with sizzle.
valerio posted about why mootools in particular was never going to use a 3-rd party project like sizzle - lookie here http://ajaxian.com/archives/mootools-and-sizzle
since that post, the need to scale the mootools selector engine must have resulted in the advent of slick (which is a standalone engine but one that the mootools team develop so its easily maintainable / patchable)
you can easily checkout slick and port it into whatever framework as well. here's a gist on using slick in mootools 1.2.x - http://gist.github.com/361474
interesting posts on use are around, http://davidwalsh.name/elements-shorthand-slick for example but it's all early adopters stuff so before 1.3 is out proper, i don't expect it getting too much attention.
as for performance, its nearly identical from some beta tests i saw a while back with sizzle getting ahead slightly on things like document.body. anyway, post your findings, would be interesting.
I realize that this is an older post, but I recently came across it while searching for a way to use Sizzle instead of Slick with MooTools, specifically as an effort to improve performance. Ultimately I couldn't find anything existing, but the Gist referenced above lead me to writing a library that allows swapping out Slick for Sizzle without altering the MooTools API. I am sharing it here as a point of reference for anyone else who may come across this post with similar intent. The library can be found on GitHub at https://github.com/mzabriskie/sickle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With