Customizing JQuery autocomplete to add Static HTML content before and after the list -
hey need add html content before , after list dynamically generated using autocomplete........the following code snippet..i have tried append, prepend li
no luck......and need limit number of items in list maximum 5. how do it?
$(document).ready(function () { $("#autocomplete").autocomplete({ source: source, select: function (event, ui) { window.location.href = ui.item.value; this.autohide(); } }) .data("autocomplete")._renderitem = function (ul, item) { $("<li></li>") .data("item.autocomplete", item) .append("<a>" + "<img src='" + item.imgsrc + "' /><strong>" + item.label + "</strong></a>") .appendto(ul) }; });
take @ jqfaq.com link. explain how add text @ starting , ending of autocomplete's result list.
take @ other autocomplete related faqs in list might of interest you.
Comments
Post a Comment