2012-04-18 4 views

答えて

1

はい。あなたはjQuery BBQを使用するアイソトープにhash history addinを使用できます。

この例は、Isotopeドキュメントのハッシュ履歴ページのソースからのコピーパスタです。

$(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'); 

}); 
+0

OOOええ。ソートされました。乾杯。ありがとう。 – user1340101

+2

こんにちは、あなたはその例を挙げることができますか? jsfidlleのように。 – IAMTHESTIG

関連する問題