2011-08-16 26 views

回答

1

如果您設置鏈接像fruit.php#蘋果,你可以寫一些JavaScript解析井號標籤,並在頁面加載過濾收集:

if(window.location.hash) { 
    // run code here to filter the quicksand set 
    var $filteredData = $data.find('li[data-type=' + window.location.hash + ']'); 
    $applications.quicksand($filteredData, { 
     duration: 800 
    }); 
} 
+1

艾米莉,你做得很好,幫我在此;謝謝!我確信有更好的方法來做這件事,但是對於我的實例,需要注意一些事情:window.location.hash包含「#」char; window.location.hash.substring(1)修復了這個問題;請注意$ data和$ applications變量的範圍,您可能想要對反映選擇的視覺元素進行分類。如果有興趣,我可以發佈更多信息。 – Screenack