Answer the question
In order to leave comments, you need to log in
How to hide dom elements in a script?
Found a Goocompleter script based on mootools. Everything works fine, but here's one nuance I can't win - if you don't select values from the autocompletion list, then the list continues to hang. How to make it cleared by timeout or by switching to another autocomplete field? The script itself is large - I don't know how to attach it here. Only a link to the source: Script In advance, all fenks!
Answer the question
In order to leave comments, you need to log in
I found the answer myself on the expanses of tyrnet. It was possible to fasten the timer directly to the procedure for forming a drop-down list. In general, it is surprising that the author wrote a good library, but did not take care of cleaning up the tails. Especially if you have to enter your value in the field with auto-coupling.
It’s hard to say without a working demo, but the following construction is repeated many times there:
// Hide typebox
if (this.options.use_typebox)
this.typebox.empty();
// Hide new result list
if (this.options.use_listbox)
this.listbox.setStyle('display', 'none');
var myAutocompleter = new GooCompleter(/*...*/);
if (/* что-то случилось */) {
myAutocompleter.typebox.empty();
myAutocompleter.listbox.setStyle('display', 'none');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question