模仿百度查询的智能提示
先看看效果图:

代码部分:
CSS代码:
<style type="text/css">
#searchresult
{
width: 130px;
position: absolute;
z-index: 1;
overflow: hidden;
left: 130px;
top: 71px;
background: #E0E0E0;
border-top: none;
}
.line
{
font-size: 12px;
background: #E0E0E0;
width: 130px;
padding: 2px;
}
.hover
{
background: #007ab8;
width: 130px;
color: #fff;
}
.std
{
width: 150px;
}
</style>
html代码(本文采用的asp.net页面编写的):
<body>
<form id="form1" runat="server">
<div>
智能模糊查询提示
<input id="txt_search" type="text" style="width: 150px;" />
<div id="searchresult" style="display: none;">
</div>
</div>
</form>
</body>
jquery代码部分:
<script type="text/javascript">
$(function () {
$("#txt_sea

这篇博客介绍了如何模仿百度查询的智能提示功能,通过结合jQuery和Ajax技术,实现在文本框输入时自动显示相关建议的效果。文章包含代码展示,主要涉及CSS和ASP.NET页面的HTML部分。
最低0.47元/天 解锁文章
550

被折叠的 条评论
为什么被折叠?



