Bonjour, je rencontre un souçis pour créer un modul de filtre en jQuery .
<input type="text" id="search" placeholder="Search project">
<ul id="list-project">
<?php $projects = list_projets(ROOT);?>
<?php foreach ($projects as $p):?>
<li><a class="colored" data-name="<?= $p;?>" href="<?= '../'.$p;?>"><?= $p;?></a></li>
<?php endforeach;?>
</ul>
$(document).ready(function(){
$("#search").keyup(function(){
var filter = $(this).val();
$("#list_projets li a").each(function(){
if ($(this).data('name').search(new RegExp(filter, "i")) < 0)
{
$(this).fadeOut();
}
else
{
$(this).show();
}
});
});
});
Le debuger me sort aucune erreur, et pourtant il ne fonctionne pas .
Auriez vous une piste svp ?