Javascript 我可以从不同的页面传递筛选值吗?

Javascript 我可以从不同的页面传递筛选值吗?,javascript,jquery,jquery-isotope,Javascript,Jquery,Jquery Isotope,我正在一个项目中使用 我可以从不同页面上的a href链接向其传递筛选器值吗?因此,当我使用同位素登录页面时,它会根据a href过滤布局。是。你可以使用同位素,它利用了 此示例仅来自同位素文档上哈希历史页面的源 $(window).bind( 'hashchange', function( event ){ // get options object from hash var hashOptions = window.location.hash ? $.deparam.fra

我正在一个项目中使用

我可以从不同页面上的a href链接向其传递筛选器值吗?因此,当我使用同位素登录页面时,它会根据a href过滤布局。

是。你可以使用同位素,它利用了

此示例仅来自同位素文档上哈希历史页面的源

$(window).bind( 'hashchange', function( event ){
    // get options object from hash
    var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {},
        // do not animate first call
        aniEngine = hashChanged ? 'best-available' : 'none',
        // apply defaults where no option was specified
        options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } );
// apply options from hash
$container.isotope( options );
// save options
isotopeOptions = hashOptions;

// if option link was not clicked
// then we'll need to update selected links
if ( !isOptionLinkClicked ) {
  // iterate over options
  var hrefObj, hrefValue, $selectedLink;
  for ( var key in options ) {
    hrefObj = {};
    hrefObj[ key ] = options[ key ];
    // convert object into parameter string
    // i.e. { filter: '.inner-transition' } -> 'filter=.inner-transition'
    hrefValue = $.param( hrefObj );
    // get matching link
    $selectedLink = $optionSets.find('a[href="#' + hrefValue + '"]');
    changeSelectedLink( $selectedLink );
  }
}

isOptionLinkClicked = false;
hashChanged = true;
})

    // trigger hashchange to capture any hash data on init
    .trigger('hashchange');

});
对。你可以使用同位素,它利用了

此示例仅来自同位素文档上哈希历史页面的源

$(window).bind( 'hashchange', function( event ){
    // get options object from hash
    var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {},
        // do not animate first call
        aniEngine = hashChanged ? 'best-available' : 'none',
        // apply defaults where no option was specified
        options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } );
// apply options from hash
$container.isotope( options );
// save options
isotopeOptions = hashOptions;

// if option link was not clicked
// then we'll need to update selected links
if ( !isOptionLinkClicked ) {
  // iterate over options
  var hrefObj, hrefValue, $selectedLink;
  for ( var key in options ) {
    hrefObj = {};
    hrefObj[ key ] = options[ key ];
    // convert object into parameter string
    // i.e. { filter: '.inner-transition' } -> 'filter=.inner-transition'
    hrefValue = $.param( hrefObj );
    // get matching link
    $selectedLink = $optionSets.find('a[href="#' + hrefValue + '"]');
    changeSelectedLink( $selectedLink );
  }
}

isOptionLinkClicked = false;
hashChanged = true;
})

    // trigger hashchange to capture any hash data on init
    .trigger('hashchange');

});

嗨,伙计们,你们能举个例子吗?就像一个jsfidlle。嗨,伙计们,你们能举个例子吗?就像一个游手好闲的人。