the css menu is not a problem

Jan 10, 2014

Search field?


Hey gang, just upgraded from the Flash to SWIMBI and the one thing I seem to be missing is the "search field" option. Thoughts? Thanks.

Answer:

Hi,
we will add the search feature in future version.

For now you are free to add any search field in the menu HTML code.

Example:

- replace the last button code with this

<li><a href="#"> <input id="search-input" name="search" type="text" > </a></li>

- add the following code after the Swimbi code

<!-- swimbi code end -->
<style>
#search-input{
width: 120px;
height: 22px;
padding-top:0px;
margin-top:0;
text-align:center;
display: inline-block;
border:1px solid #777;
border-radius: 5px;
background-repeat:no-repeat;
background-position:left;outline:0;
box-shadow: 0 1px 1px rgba(0,0,0,.4) inset, 0 1px 0 rgba(255,255,255,.2);
text-shadow: 0 -1px 0 rgba(0, 0 ,0, .3);
}
</style>
<script type="text/javascript">
var searchInput = document.getElementById("search-input");
if(searchInput.value){
searchInput.style.backgroundImage = 'none';
}
searchInput.onclick = function(){
this.style.backgroundImage = 'none';
}
searchInput.onkeydown = function(){
if(event.keyCode == 13){
}
}
</script>

Regards
Dmitry



No comments: