| 42 |
lars |
1 |
<script>
|
|
|
2 |
$(document).ready(function(){
|
|
|
3 |
|
|
|
4 |
var suchbegriff = "";
|
|
|
5 |
|
|
|
6 |
$("#suchbegriff").autocomplete({
|
|
|
7 |
|
|
|
8 |
source: "/source/includes/content/search.php?autocomplete=true",
|
|
|
9 |
minLength: 1,
|
|
|
10 |
open: function(event, ui) {
|
|
|
11 |
|
|
|
12 |
$(".ui-autocomplete").css("zIndex", 1000);
|
|
|
13 |
$(".ui-autocomplete").css("textAlign", "left");
|
|
|
14 |
},
|
|
|
15 |
select: function( event, ui ) {
|
|
|
16 |
var link = ui.item.link;
|
|
|
17 |
window.location = ui.item.link;
|
|
|
18 |
},
|
|
|
19 |
focus: function(event, ui) {
|
|
|
20 |
event.preventDefault();
|
|
|
21 |
$("#suchbegriff").val(ui.item.label);
|
|
|
22 |
}
|
|
|
23 |
}).autocomplete( "instance" )._renderItem = function( ul, item ) {
|
|
|
24 |
return $( '<li></li>' ).data( "item.autocomplete", item )
|
|
|
25 |
.append( "<a href="+ item.link +"><div class='searchBild'><img src='" + item.icon + "' style='width:60px;'/></div><span class='searchLabel'>" + item.label+ "</span><div class='searchPreis'>"+ item.preis +"</div></a>" )
|
|
|
26 |
.appendTo( ul );
|
|
|
27 |
};
|
|
|
28 |
});
|
|
|
29 |
</script>
|
|
|
30 |
|
|
|
31 |
<div class="search" role="search">
|
|
|
32 |
<div id="suggest">
|
|
|
33 |
<form name="search" id="search" action="/index.php" method="get">
|
|
|
34 |
<input id="suchbegriff" type="text" name="search" value="{$smarty.get.search}" placeholder="Suchbegriff eingeben" />
|
|
|
35 |
<input type="submit" name="searchSubmit" id="searchSubmit" value=""/>
|
|
|
36 |
|
|
|
37 |
</form>
|
|
|
38 |
</div>
|
|
|
39 |
</div>
|