Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#people').autocomplete({
- source: base_url + "tags/jq_get_tags_by_search_as_object/" + $("#bookmark-active").val() + "/3",
- appendTo: ".people-results",
- messages: {
- noResults: function(event, ui) {
- $(this).addClass( "automcomple-results" );
- $(this).text("I can't find any Tags.");
- },
- results: function(event, ui) {
- $(this).addClass( "automcomple-results" );
- $(this).text(event + " Tags found.");
- }
- },
- position: { my : "left top", at: "left bottom", collision: "flipfit" },
- open: function(event, ui) {
- $('ul.ui-autocomplete#tags-people')
- .removeAttr('style')
- .hide()
- .appendTo('.people-results')
- .show();
- },
- select: function(event, ui) {
- $('.people-results')
- .append('<div class="bookmark-tag-box" id="bookmark-tag-people-box-' + ui.item.tag_id + '"><input type="checkbox" id="bookmark-tag-people-item-' + ui.item.tag_id + '" name="bookmark-tags-people-add[' + ui.item.tag_id + ']" value="' + ui.item.tag + '" checked="checked">' + ui.item.tag + '</div>');
- }
- }).data("uiAutocomplete")._renderItem = function(ul, item) {
- return $('<li></li>')
- .data("item.autocomplete", item)
- .append('<a>' + item.tag + '</a>')
- .appendTo(ul);
- };
- });
- span.ui-helper-hidden-accessible { display: none; }
- .automcomple-results { background-color: white; border-bottom: 3px solid white; border-left: 5px solid white; border-right: 5px solid white; border-top: 3px solid white; border-radius: 5px; margin: 5px; }
- $(this).text(event + " Tags found.");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement