Slick 与 Sizzle——CSS 选择器引擎的优缺点
我什么时候想使用 Slick,什么时候想使用 Sizzle?作为独立的 CSS 选择器引擎,它们各自的优缺点是什么? Slick 与 JQuery 一起使用有多容易? Sizzle 可以与 Mootools 一起使用吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://davidwalsh.name/mootools-sizzle - 使用带有 sizzle 的 mootools。
valerio 发布了关于为什么 mootools 特别不会使用像 sizzle 这样的第 3 方项目的文章 - 在这里查看 http://ajaxian.com/archives/mootools-and-sizzle
自那篇文章以来,扩展 mootools 选择器引擎的需求必定导致了 slick 的出现(这是一个独立的引擎,但mootools 团队开发的它易于维护/可修补)
您可以轻松签出 slick 并将其移植到任何框架中。这是在 mootools 1.2.x 中使用 slick 的要点 - http://gist.github.com/361474
有关使用的有趣帖子,http://davidwalsh.name/elements-shorthand-slick 例如,但它都是早期采用者的东西,所以在 1.3 正式发布之前,我不希望它得到太多关注。
至于性能,它与我不久前看到的一些 beta 测试几乎相同,并且在 document.body 等方面稍稍领先。不管怎样,发布你的发现,会很有趣。
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.
我意识到这是一篇较旧的文章,但我最近在寻找一种在 MooTools 中使用 Sizzle 而不是 Slick 的方法时遇到了它,特别是为了提高性能。最终我找不到任何现有的东西,但上面引用的要点引导我编写了一个库,允许在不改变 MooTools API 的情况下将 Slick 替换为 Sizzle。我在这里分享它,作为可能有类似意图的其他人的参考点。该库可以在 GitHub 上找到: https://github.com/mzabriskie/sickle
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