jquery自动完成中_renderItem的CSS破坏

CSS breaking with _renderItem in jquery autocomplete

本文关键字:renderItem CSS 破坏 jquery      更新时间:2023-09-26

我在jquery自动完成中面临_renderItem的一些问题。

我有一个自动完成小提琴(不使用_renderItem) - https://jsfiddle.net/fuyfksLd/

This code has a different CSS than usual

我添加了一些CSS,这是打破当我添加_renderItem代码- https://jsfiddle.net/fjwbLnhv/。

The background of the list items shrinks.

我做错了什么

    add in css

   .ui-autocomplete .ui-menu-item a{
   text-decoration: none;
        display: block;
       width: 100%;
       height: 100%;
  }

您需要将<li>的内容放置在div中而不是锚中,例如:

<div class="ui-menu-item-wrapper">ActionScript</div>

使用不同的样式