YUI3 - Autocomplete with local images -


i'm trying make input auto-completion since 'm working emoticons need show picture , text on list of recommendations

<div id="demo" class="yui3-skin-sam">   <input id="ac-input" type="text"> </div>  yui().use('autocomplete', 'autocomplete-filters', 'autocomplete-highlighters', function (y) {   y.one('#ac-input').plug(y.plugin.autocomplete, {     resultfilters    : 'phrasematch',     resulthighlighter: 'phrasematch',     source           : ['alabama','alaska','arizona']   }); }); 

the output should like

enter image description here

thanks !!!

here great example right yui3 documentation: http://yuilibrary.com/yui/docs/autocomplete/ac-flickr.html?mock=true

the important part of code result formatter:

    resultformatter: function (query, results) {        return y.array.map(results, function (result) {           return '<div class="result">' +              '<img class="photo" src="' + getimageurl(result) + '" alt="thumbnail">' +              '<span class="title">' + result.highlighted + '</span>' +            '</div>';        });     } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -