Examples of Using the Autocompletion Mechanism
Now that you understand how to use and manage suggestion lists, let’s create some scripts that implement the autocompletion mechanism.
Specifying the Width of the List of Suggestions
jQuery UI itself calculates the width of the list of suggestions based on its content. However, it may be useful to specify the width of the list manually. In this example, we set the list of suggestions to 400 pixels wide (see Figure 9-4):
The list corresponds to the
<ul> (created automatically by jQuery UI
when using the
method). It was explained earlier that it was easier to retrieve it
<ul> element is
recovered (through its jQuery class object), simply resize it using the
css () instruction. This can be done only when the list will be displayed, hence the use of the ...