Isotope 和 Masonry jQuery 插件之间的区别

我最近发现了 砌体 和 同位素 JQuery 插件.它们似乎在功能上几乎相同,并且似乎都具有相同的作者.我能看到的唯一明显区别是许可证.

I recently discovered the Masonry and Isotope JQuery plugins. They seem to be functionally almost identical and both appear to have the same author. The only obvious difference I can see is the license.

这两者在功能方面的主要区别是什么?为什么要使用一个而不是另一个?

What are the main differences between these two in terms of functionality? Why would you use one over the other?

推荐答案

摘自作者访谈:

对于某些人来说,同位素看起来与您之前使用 Masonry 所做的工作非常相似;你能解释一下主要区别吗两者之间?

同位素具有 Masonry 缺乏的几个特征.砌体本质上做一件事,将项目元素放置在级联排列中.Isotope 内置了 Masonry 的布局逻辑,但除此之外,它还有几种其他的布局模式可以用来动态的位置元素.您甚至可以开发自己的自定义布局模式.

Isotope has several features that Masonry lacks. Masonry essentially does one thing, placing item elements in a cascading arrangement. Isotope has Masonry’s layout logic built in, but in addition, it also has several other layout modes that can be used to dynamically position elements. You can even develop your own custom layout mode.

正如我所提到的,它内置了过滤和排序功能in. 过滤项目就像传入一个 jQuery 选择器一样简单:

As I’ve mentioned, it has filtering and sorting functionality built in. Filtering items is as easy as passing in a jQuery selector:

$('#container').isotope({ filter: '.my-selector' });

Isotope 充分利用了目前最好的浏览器功能.Isotope 没有使用典型的左/上样式定位,而是采用渐进增强方法并在支持时使用 CSS 转换通过浏览器.这为一流的性能提供了一流的性能浏览器.随着硬件加速的启动,动画看起来很流畅在 WebKit 浏览器上流畅,甚至在使用 iOS 的功能较弱的设备上.CSS 转换在 CSS 转换中表现更好,我将讨论稍后.

Isotope takes advantage of the best browser features out there. Instead of using typical left/top styles positioning, Isotope takes a progressive enhancement approach and uses CSS transforms if supported by the browser. This provides for top-notch performance for top-notch browsers. With hardware acceleration kicking in, animations look silky smooth on WebKit browsers, and even less-powerful devices using iOS. CSS transforms perform better with CSS transitions, which I’ll discuss later.

另一个区别是@AminAriana 指出的许可证.Masonry 属于 MIT 许可,但 Isotope 仅免费供个人使用.

Another difference is license as @AminAriana pointed out. Masonry is under the MIT license, but Isotope is only free for personal use.

您可以在 此页面.

相关文章