Files
EasySoft-ZenTaoPMS/module/product/js/browse.js
T
2015-10-13 02:11:36 +08:00

21 lines
711 B
JavaScript

$(function()
{
if(browseType == 'bysearch') ajaxGetSearchForm();
$('.dropdown-menu.with-search .menu-search').click(function(e)
{
e.stopPropagation();
return false;
}).on('keyup change paste', 'input', function()
{
var val = $(this).val().toLowerCase();
var $options = $(this).parents('ul.dropdown-menu.with-search').find('.option');
if(val == '') return $options.removeClass('hide');
$options.each(function()
{
var $option = $(this);
$option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0);
});
});
})