如何从右到左使用jQuery同位素? [英] How to use jQuery Isotope in Right-to-Left?

查看:93
本文介绍了如何从右到左使用jQuery同位素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在漂亮的 jQuery Isotope ( GitHub上的源代码)?

谢谢!

推荐答案

您有两个选择:重新设计同位素的布局逻辑,或构建自己的布局模式.

You have two options: Re-engineer Isotope's layout logic, or build your own layout mode.

同位素的布局逻辑已逐步增强,以在可用时使用CSS变换,但会退回到顶部/左侧的位置.因此,如果将坐标x,y传递给getPositionStyles方法,它将以{ translate: [ x, y ] }{ left: x; top: y }返回.从右到左的布局的问题在于它可以与{ right: x; top: y }一起使用,但是会与CSS转换等效项中断.

Isotope's layout logic is progressively enhanced to use CSS transforms when available, but fall back to top/left positioning. So if you pass in coordinates x, y to the getPositionStyles method it will either return with { translate: [ x, y ] } or { left: x; top: y }. The problem with right-to-left layouts is that it would work with { right: x; top: y }, but it would break with the CSS transform equivalent.

建立自己的布局模式可能是更容易访问的路线.最终,我需要编写有关如何开发自己的自定义布局模式的文档.但是,您可能可以通过阅读源代码自己完成此操作.您会发现每种布局模式都分为4种必需的方法_layoutnameReset_layoutnameLayout _layoutnameGetContainerSize_layoutnameResize.

Building your own layout mode might be the more accessible route. Eventually I need to write the docs as to how to develop your own custom layout mode. But you might able to do it yourself by reading the source. You'll find that each layout mode is broken up into 4 required methods _layoutnameReset, _layoutnameLayout _layoutnameGetContainerSize and _layoutnameResize.

我已经在GitHub上打开了问题,因此您可以跟踪此状态功能请求.

I have opened an issue on GitHub so you can track status on this feature request.

这篇关于如何从右到左使用jQuery同位素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆