auto-complete suggestions get hide when Im trying to select

auto-complete suggestions get hide when Im trying to select

Im trying to implement jquery in my page.
my code is as follow. also have attached my jquery.

$("#username").autocomplete({
source: function( request, response ) {
var username= $('#username').val();
$.ajax({
url: "/message/ajaxuserslist",
dataType: "json",
data: "fieldId=users&username="+username,
success: function(data) {
response($.map(data, function(item) {
return {
label: item.UNAME,
  };
}));
},
});
},
minLength: 1,
noResults : '',
        results : function(resultsCount) {},
select: function (event, ui) {
$('#username').val(ui.item.id);
}
});


It works fine for first time but when I move to another page (only middle div get changed using ajax) and come back, auto-complete functionality shows suggestions but it get hide when i try to select it using mouse.

Thank in advance...