For example: If I have a page called fruit.php with Quicksand and the filters are 'All', 'Apple', and 'Bananas' and it is set to 'All' by default, can I link to fruit.php from some other page and have quicksand pre-filtered to 'Apple' or 'Banana' instead?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you set up your links like fruit.php#apple, you can write some javascript to parse the hashtag and filter the collection on the page load:
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
});
}