ok heres the code, if i remove the div.off in the selector at the bottom i get the test alert as that element is not generated source.
$(document).ready(function(){
$(".search_container input").keyup(function(){
var search;
search = $(".search_container input").val();
if (search.length > 2){
$.ajax({
type: "GET",
url: "http://localhost:8080/search.xml",
data: "zoom_query=" + search + "&zoom_xml=1",
dataType: "xml",
success: function(xml){
$("#auto_suggest").empty();
$("#auto_suggest").show();
var _title = "";
var _link = "";
$("item", xml).each(function(){
_title = $("title", this).text();
_link = $("link", this).text();
_context = $("zoom\\:context", this).text();
if ($(this).length > 0){
message = "<div class=\"off\">";
message += "<div title='" + _context + "'>" + _title + "</div>";
message += "<small>" + _link + "</small>";
message += "</div>";
$("#auto_suggest").append(message);
}
else {
$("#auto_suggest").hide();
}
});
}
});
}
else {
$("#auto_suggest").hide();
};
});
$("#auto_suggest div.off").hover(function(){
alert('test');
});
});