jQuery( document ).ready(function( $ ) {
$( "#block_search_keywords" ).autocomplete({
source: '',
minLength: 2,
delay: 500,
appendTo: "#search-auto-suggest",
open: function() {
var position = $("#search-auto-suggest").position(),
left = position.left, top = position.top, width = $("#search-auto-suggest").width();
$("#search-auto-suggest > ul").css({left: (left + 36) + "px",
top: (top + 66) + "px" }).width(width - 11);
}
}).data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li>" )
.append( "<a><span>" + item.label + "</span></a>" )
.appendTo( ul );
};
});
$( "#block_search_keywords" ).autocomplete({
source: '',
minLength: 2,
delay: 500,
appendTo: "#search-auto-suggest",
open: function() {
var position = $("#search-auto-suggest").position(),
left = position.left, top = position.top, width = $("#search-auto-suggest").width();
$("#search-auto-suggest > ul").css({left: (left + 36) + "px",
top: (top + 66) + "px" }).width(width - 11);
}
}).data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li>" )
.append( "<a><span>" + item.label + "</span></a>" )
.appendTo( ul );
};
});
Комментарии
Отправить комментарий