例如:如果我有一个带有流沙的名为fruit.php 的页面,过滤器是“All”、“Apple”和“Bananas”,并且默认设置为“All”,我可以从一些链接到fruit.php其他页面并将流沙预过滤为“Apple”或“Banana”?
1 回答
1
如果您设置了像 fruit.php#apple 这样的链接,您可以编写一些 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
});
}
于 2011-12-13T17:07:24.653 回答