Based on @nchaud comment...
$(window).load(function(){
//e.g. website.com/index/filter#games
var str = document.URL;
//games
if ((str.lastIndexOf('#'))!== -1) {
var $criteria=str.substring(str.lastIndexOf('#'));
} else {
var $criteria = '#all';
}
This sets the variable $criteria to the matching id of the link for the category in the navigation.
var $container = $('.creations-container');
$container.isotope({
filter: '*',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
$('.creations-filter a').click(function(){
$('.creations-filter .current').removeClass('current');
$(this).addClass('current');
var selector = $(this).attr('data-filter');
$container.isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
return false;
});
$($criteria).trigger("click");
this clicks on the element with the id in the url