jQuery 同位素组合过滤器与 BBQ 哈希历史混合 - 需要帮助了解如何
我试图了解如何将 组合过滤器 与 Jquery BBQ 哈希历史记录。
我想做的是让用户按徽标、身份或品牌进行过滤。如果用户单击徽标,我希望他们能够按“非营利、教育、零售”等进行子过滤。我知道组合过滤器在没有实现 jquery BBQ 代码的情况下工作正常,但我想两者都做。
$optionSets.find('.filter-main a').click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return;
}
changeSelectedLink( $this );
// get href attr, remove leading #
var href = $this.attr('href').replace( /^#/, '' ),
// convert href into object
// i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' }
option = $.deparam( href, true );
// apply new option to previous
$.extend( isotopeOptions, option );
// set hash, triggers hashchange on window
$.bbq.pushState( isotopeOptions );
isOptionLinkClicked = true;
return false;
});
I am trying to understand how to use Combination filters with Jquery BBQ Hash History.
What I want to do is have the user filter by Logos, Identity or Branding. If the user clicks Logos, I want them to then be able to subfilter by "Non-Profit, Education, Retail" etc. I know combination filters work fine without the jquery BBQ code implemented, but I would like to do both.
$optionSets.find('.filter-main a').click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return;
}
changeSelectedLink( $this );
// get href attr, remove leading #
var href = $this.attr('href').replace( /^#/, '' ),
// convert href into object
// i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' }
option = $.deparam( href, true );
// apply new option to previous
$.extend( isotopeOptions, option );
// set hash, triggers hashchange on window
$.bbq.pushState( isotopeOptions );
isOptionLinkClicked = true;
return false;
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅http://support.metafizzy.co/2011/isotope-组合过滤器哈希链接.html
See http://support.metafizzy.co/2011/isotope-combo-filters-hash-links.html