我有一个包含FAQ的页面。静态页面上的搜索框
的想法是实现其对Font awesome Icons
显示随着一点点的在线帮助的那个我已经能够产生以下代码的外观&感觉一个搜索框:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing a search bar</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://use.fontawesome.com/e34d8d1dc9.js"></script>
<script src="/Scripts/Searchbar.js"></script>
<link href="/CSS/woff2.css" rel="stylesheet" type="text/css" />
<link href="/CSS/site.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container" data-view="search">
<div class="row">
<div class="col-md-10 col-sm-9">
<section id="search">
<label for="searchinput"><i class="fa fa-search" aria-hidden="true"></i><span class="sr-only">Search FAQ</span></label>
<input id="searchinput" class="form-control input-lg" placeholder="Search FAQ" autocomplete="off" spellcheck="false" autocorrect="off" tabindex="1">
</section>
</div>
</div>
<div id="faqs">
<h3>Question 1</h3>
<section>
Answer 1<br> abc
</section>
<h3>Question 2</h3>
<section>
Answer 2<br>xyz
</section>
<h3>Question 3</h3>
<section>
Answer 3<br>def
</section>
</div>
</div>
</body>
</html>
代码使用2个CSS - 文件:
和1 java script file。
虽然页面(这只是一个当然的测试)看起来&感觉我在找,搜索功能还没有工作。
这里谁能告诉我,我必须做的,使其工作就像例子吗?
的问题添加CSS以上的标签来吸引正确的人更快 –
你最好的选择是使用这个,http://listjs.com/,永远不要重新发明轮子。 –
我意外地发布了一个链接到错误的js文件。它应该是这一个:[searchbar.js](https://dl.dropboxusercontent.com/u/54991757/Webdeveloper.com/Search%20on%20a%20static%20page/searchbar.js) – Fysicus