.target
property of the event object refers to the target of the event, you can read this property:
$pageslide.click(function(e) {
if ( $.inArray(e.target.localName, ['li', 'a']) < 0 ) {
e.stopPropagation();
}
});
Or use .closest()
method:
if ( $(e.target).closest('a').length === 0 ) {
e.stopPropagation();
}