You need to provide the Event
parameter:
$('.album a').click(function(e){
e.preventDefault();
//other codes
});
You don't need to deal with returnValue
, as jQuery normalizes the method to work across browsers, by only calling preventDefault
.
Note how the handler in the docs show this eventObject
as the parameter passed to it: http://api.jquery.com/click/
And note how the Event
object has the preventDefault
method: http://api.jquery.com/category/events/event-object/