<ul id="portfolio-filter"> <li class="website"><a class="website" href="[[~[[*id]]? &scheme=`full`]]#website" rel="website">Websites</a></li> <li class="logo"><a class="logo" href="[[~[[*id]]? &scheme=`full`]]#logo" rel="logo">Logos</a></li> <li class="print"><a class="print" href="[[~[[*id]]? &scheme=`full`]]#print" rel="print">Print</a></li> <li class="all"><a class="all" href="[[~[[*id]]? &scheme=`full`]]#all">All Work</a></li> </ul> <ul id="portfolio-list"> <li class="website"><a class="webwork" href="work-proshot.html" rel="fancybox" title="Proshot Directional Boring - Website Design"><img alt="Proshot Directional Boring" src="assets/images/work/proshot.gif" /> </a> <p>Proshot Directional Boring</p> </li> </ul>
(function ($) {
$.fn.filterable = function (settings) {
settings = $.extend({
useHash: true,
animationSpeed: 1000,
show: {
width: 'show',
opacity: 'show'
},
hide: {
width: 'hide',
opacity: 'hide'
},
useTags: true,
tagSelector: '#portfolio-filter a',
selectedTagClass: 'current',
allTag: 'all'
}, settings);
return $(this).each(function () {
$(this).bind('filter', function (e, tagToShow) {
if (settings.useTags) {
$(settings.tagSelector).removeClass(settings.selectedTagClass);
$(settings.tagSelector + ' [ href=' + tagToShow + ' ] ').addClass(settings.selectedTagClass);
}
$(this).trigger('filterportfolio', [tagToShow.substr(1)]);
});
$(this).bind('filterportfolio', function (e, classToShow) {
if (classToShow == settings.allTag) {
$(this).trigger('show');
} else {
$(this).trigger('show', [ '.' + classToShow ] );
$(this).trigger('hide', [ ':not(.' + classToShow + ')' ] );
}
if (settings.useHash) {
location.hash = '#' + classToShow;
}
});
$(this).bind('show', function (e, selectorToShow) {
$(this).children(selectorToShow).animate(settings.show, settings.animationSpeed);
});
$(this).bind('hide', function (e, selectorToHide) {
$(this).children(selectorToHide).animate(settings.hide, settings.animationSpeed);
});
if (settings.useHash) {
if (location.hash != '')
$(this).trigger('filter', [ location.hash ] );
else
$(this).trigger('filter', [ '#' + settings.allTag ] );
}
if (settings.useTags) {
$(settings.tagSelector).click(function () {
$('#portfolio-list').trigger('filter', [ $(this).attr('href') ] );
$(settings.tagSelector).removeClass('current');
$(this).addClass('current');
});
}
});
};
}(jQuery));
$(document).ready(function () {
$('#portfolio-list').filterable();
});Uncaught Error: Syntax error, unrecognized expression: [ href=http://localhost/msmdModX/work.html#website ]
This question has been answered by multiple community members. See the first response.
$(settings.tagSelector + '[href=' + tagToShow + ']').addClass(settings.selectedTagClass);
tagToShow = tagToShow.substr(tagToShow.indexOf("#"));

Got it. Add just before line 25
tagToShow = tagToShow.substr(tagToShow.indexOf("#"));