我试图在输入html元素上使用jquery ui“突出显示”效果,并在CSS中设置背景图像(带有放大镜的搜索栏)。然而,在“突出显示”动画期间,背景图像会暂时消失,然后在突出显示动画结束后出现。我希望该图像在整个动画中保留。有什么想法吗?
HTML:
<input class="searchInput" id='searchInputWithMap' type="text" tabindex="100" name="searchStructures" />
CSS:
.searchInput {
font-family:Trebuchet MS,Helvetica,sans-serif;
background:transparent url(/images/search4.png) no-repeat scroll 8px 6px;
height:22px;
line-height:28px;
padding-left:32px;
padding-right:3px;
padding-top:5px;
padding-bottom:5px;
margin:5px 0;
border:1px solid #999999;
font-size:130%;
height: 32px;
width: 400px;
vertical-align:center;
color:#BBBBBB;
}
最佳答案
将 !important
添加到您的 CSS
中,如下所示:
.searchInput { background-image:url(/images/search4.png) !important; }
谨慎使用。
关于jquery - 如何使用 "highlight"jquery 效果而不暂时隐藏背景图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1731807/