jQuery:结合“可过滤的组合”和砌体布局
我正在尝试结合“可过滤的投资组合”(http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-filterable-portfolio-with-jquery/) 与 Masonry 布局...所以我希望我的项目重新调整在我过滤它们之后,它们与砖石一起,但它们停留在砖石放置它们的位置...
这是我非常粗略的第一个网站草稿: http://waynetest.kilu.de/lula/ (工作显然正在进行中..;))
是否有可能结合两个js脚本?
多谢, 凯瑟琳娜
I'm trying to combine the "filterable portfolio" (http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-filterable-portfolio-with-jquery/) with the Masonry layout ... so I want my items to readjust with masonery after I filtered them, but they stay in the position where masonery put them...
here's my very rough first website draft: http://waynetest.kilu.de/lula/
(work obviously in progress..;))
Is there a possibility to combine both js-scripts?
thanks a lot,
katharina
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您随时可以尝试 http://isotope.metafizzy.co/
You could always try http://isotope.metafizzy.co/
首先创建一个隐藏的div并将真实数据放入其中。在此示例中,我们将其称为#hidden。然后为主 Masonry 创建一个空白 div。我们称之为#masonry。因此,到目前为止,我们有这样的情况:
项目将通过其数据相关进行检测,因此不要忘记将所有过滤器作为项目的数据相关。例如:
作为过滤器,创建一个如下所示的列表:
现在,以这种方式处理初始填充和过滤功能:
此方法在 Masonry v4 上进行了测试,效果最好。
First create a hidden div and put the real data to it. In this example we call it #hidden. Then create a blank div for the main Masonry. We call it #masonry. So, we have something like this so far:
The items will be detected by their data-rel so don't forget to all the filters as data-rel to the items. E.g:
As the filters, create a list like this:
Now, handle the initial filling and the filtering functions this way:
This method is tested on Masonry v4 and the best.
我也想要同样的东西,终于让它发挥作用了。
请参阅:http://jasondaydesign.com/masonry_demo/
希望这能满足您的需求。
I wanted the same thing and finally have it working.
See: http://jasondaydesign.com/masonry_demo/
Hopefully that works for your needs.