我正在使用 Struts2 jQuery 插件 2.1 并在我的 JSP 中呈现一个自动完成程序。这是代码:
<s:form id="search-form" action="search" theme="simple">
<s:url id="remoteurl" action="jsonlanguages"/>
<div>
<sj:autocompleter
cssClass="bgstandardelement empty"
id="languages"
name="echo"
href="%{remoteurl}"
delay="50"
value="Search..."
/>
<input type="submit" id="search-button" value="GO" />
</div>
</s:form>
无论我将 autocompleter-form 设置为什么主题,为我输出的列表呈现的 HTML 始终是一个无序列表,其中包含我无法覆盖的样式元素。它具有以下 stype 属性:
style='z-index: 1; top: 242px; left: 926px; display: none; width: 256px';
因为我想为我的 list 添加另一套服装,所以这行不通。输入以下属性无效:
cssStyle="width:115px!important;"
我能做什么?
最佳答案
澄清一下:我想这一定是我的一个错误。使用 theme="simple"应该可以消除所有样式,因此您可以使用 CSS 自行完成所有操作。我也可能在呈现的 struts2-head 元素中设置了一个主题并将其删除。抱歉提问,现在可以了。
关于jquery - Struts2 jQuery 插件自动完成器呈现具有样式属性的 HTML <== 改变这个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2857122/