<script src="js/jquery-1.7.2.min.js"></script>
<script src="assets/js/owl_slider/jquery-1.9.1.min.js"></script>
<script src="js/jquery.ui.core.min.js"></script>
<script src="js/jquery.ui.widget.min.js"></script>
<script src="js/jquery.ui.position.min.js"></script>
<!--<script src="js/jquery.ui.autocomplete.min.js"></script> -->
<script src="js/jquery-ui-1.9.0/ui/jquery-ui.js"> </script>
<link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css" type="text/css" />
<script>
$.widget( "custom.catcomplete", $.ui.autocomplete, {
_renderMenu: function( ul, items ) {
var self = this,
currentCategory = "";
$.each( items, function( index, item ) {
//alert("index="+index+" and item = "+item);
if ( item.category != currentCategory )
{
ul.append( "<span class='ui-autocomplete-category' style='float:left;'> -- In "+ item.category + " </span>" );
currentCategory = item.category;
}
return $( "<li></li>" )
.append( "<a href='product_description.php?pid="+item.id+ "'>"+ item.value + "</a>" )
.appendTo( ul );
// self._renderItemData(ul, item);
});
}
});
$(function() {
$( "#search1" ).catcomplete({
delay:0,
source: "searchProd.php?termm="+ $("#search1").val(),
});
});
$(".ui-menu-item").on('click', function(e) {
location.href = $(this).children("a").attr("href") ;
});
</script>