I have a number of list items that contain images within links. When one of these links is clicked, I want to get containing li
's rel attribute only, without following the click event though. Following the event through currently opens the link image up in a new page which I do not want.
I have tried return false;
within my function but this doesnt work (see below). I have also tried this on the actual link in the mark up but I would rather not do this as this isn't best practice.
$('a.main-img').click(function (){
var liRel = $(this).closest('li').attr('rel');
var relNumber = $('#banner-holder').find('img').attr('id', liRel);
rotatePics(relNumber);
return false;
});