简体   繁体   English

同位素shiftColumnOfItem与hashHistory结合-如何?

[英]Isotope shiftColumnOfItem combined with hashHistory - how to?

I'm using Isotope to filter a set of items and JQuery BBQ to handle the hashHistory stuff. 我正在使用同位素过滤一组项目,并使用JQuery BBQ处理hashHistory内容。

It's working fine, except for the following: the items are initially collapsed - when clicked, they expand and display more text. 除以下内容外,它工作正常:最初折叠了这些项目-单击它们会展开并显示更多文本。 But when one of the items is expanded, the filtering info gets lost (which is obvious, as I'm not sending them on click yet) and I see all items again on screen. 但是,当其中一项展开时,过滤信息会丢失(这很明显,因为我还没有点击发送它们),并且我再次在屏幕上看到了所有项。

On click for expanding the item, I'm now using just 单击以展开项目时,我现在仅使用

$container.isotope('shiftColumnOfItem', this.parentNode);

I have been searching but still couldn't find a way of combining this method (or reLayout) with the current filtering/hash parameters. 我一直在搜索,但仍然找不到将这种方法(或reLayout)与当前过滤/哈希参数结合的方法。 Any tips would be welcome! 任何提示都将受到欢迎!

Thank you. 谢谢。

After some more time tweaking the code, it's working. 再经过一些时间调整代码后,它便开始工作了。

It was actually more a general Javascript issue than something regarding specifically JQuery BBQ / Isotope. 实际上,这更是一个通用的Javascript问题,而不是专门针对JQuery BBQ / Isotope的问题。

I simply changed the markup for expanding/collapsing the item from 我只是简单地更改了用于扩展/折叠项目的标记

<a href="#" data-toggle="collapse" data-target="#item10-collapse">

to

<a href="javascript: void();" data-toggle="collapse" data-target="#item10-collapse">

This way, no hashChanges are registered. 这样,就不会注册任何hashChanges。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM