Skip to content

gluk-w/searhbar-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

searhbar-js

Search bar with filters

Usage

Create container with input box and link to toggle filters

<div id="search_bar">
	<input type="text" name="q"/>
</div>

<a id="advanced">Advanced</a>

Create container for filters

<div id="search_filters">
	<label>Year: <input type="text" name="year"></label>
	<label>Month: <input type="text" name="month"></label>
</div>

Include JS and CSS

<link rel="stylesheet" href="searhbar.css"/>
<script type="text/javascript" src="searchbar.js"></script>
<script type="text/javascript">
	jQuery(function($) {
		$('#search_bar').searchbar({
			'filters_container': '#search_filters',
			'filters_link': '#advanced'
		});
	});
</script>