我有一個包含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