本篇文章给大家带来的内容是关于js实现类似于联想关键词的搜索功能(附代码),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
一、页面代码:
js/jQuery实现类似百度搜索功能#container{
position:absolute;
left:50%;
top: 40%;
}
#content{
float:left;
position:relative;
right:50%;
}
input{
border:0;
width:288px;
height:30px;
font-size:16px;
padding:0 5px;
line-height:30px;
}
.item{
padding:3px 5px;
cursor:pointer;
}
.addbg{
background:#87A900;
}
.first{
border:solid #87A900 2px;
width:300px;
}
#append{
border:solid #87A900 2px;
border-top:0;
display:none;
}
二、js代码:
var data = [
"你好,我是Michae