我有一个使用javascript搜索功能的搜索栏。 onclick它会降低一些结果。但我需要设置一个时间1分钟来显示下拉结果,aslo可以使搜索功能变得老旧。
HTML CODE
<div class="dropdown">
<input onclick="myFunction()" class="dropbtn" id="myInput"
placeholder="Search Stores & Brands" onkeyup="filterFunction()">
<span class="glyphicon glyphicon-search form-control-feedback"></span>
<div id="myDropdown" class="dropdown-content">
<a href="<?php echo site_url()?>welcome/search_Bonanza">Bonanza</a>
<a href="<?php echo site_url()?>welcome/search_BestBuy">BestBuy</a>
<a href="<?php echo site_url()?>welcome/search_Belk">Belk</a>
<a href="<?php echo site_url()?>welcome/search_Benmeadows">Benmeadows</a>
<a href="<?php echo site_url()?>welcome/search_Backcountry">Backcountry</a>
<a href="<?php echo site_url()?>welcome/search_Cosme_de">Cosme - de</a>
JS CODE
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
function filterFunction() {
var input, filter, ul, li, a, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
div = document.getElementById("myDropdown");
a = div.getElementsByTagName("a");
for (i = 0; i < a.length; i++) {
if (a[i].innerHTML.toUpperCase().indexOf(filter) > -1) {
a[i].style.display = "";
} else {
a[i].style.display = "none";
}
}
}
答案 0 :(得分:0)
您可以再次切换班级列表:
{{1}}