You need to use preventDefault()
to make it so the link does not go through when u click on it:
fiddle: http://jsfiddle.net/maniator/Sevdm/
$(function() {
$('.menulink').click(function(e){
e.preventDefault();
$("#bg").attr('src',"img/picture1.jpg");
});
});