← Back to Yupput home.
← Back to Yupput developer documentation.
Press ctrl+shift+y or tap here and then type - for example - Baltic Sea or Ocean.
The variable sampleData has been assigned from opendata.ytils.com.
var yupput;
var demoInputHandle = document.getElementById("yupputDemoEvent");
var tapHandle = document.getElementById("ytilsYupputTapOpener");
var sampleData = Ytils.YupputOpenData.YtilsYupputDataDefault;
var yupputSelectionCallback = function(selectedYupputItem, inputValue) {
demoInputHandle.value = "Selected item with value: " + selectedYupputItem.value;
yupput.hide();
};
yupput = new Ytils.Yupput(sampleData, yupputSelectionCallback, {
placeholder: "Welcome to the Yupput demo.",
preloadImages: true,
callbackOnChange: function(inputValue) {
if (null === inputValue || inputValue === "") {
demoInputHandle.value = "Yupput awaits your input.";
} else {
demoInputHandle.value = "Input changed: " + inputValue;
}
},
callbackThumbnailClick: function(itemVal, itemThumbnail) {
demoInputHandle.value = "Clicked thumbnail image: " + itemThumbnail;
}
});
tapHandle.onclick = function() {
yupput.show();
};