Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/06/2013, 12:38
janndo
 
Fecha de Ingreso: febrero-2011
Mensajes: 40
Antigüedad: 13 años, 2 meses
Puntos: 0
Pregunta Filtro con rango

Hola, bueno tengo creado un filtro con checkbox pero solo me busca un termino, osea si busco 2 seguidos no hace nada (se pone en blanco)

Este es el HTMl
Código HTML:
<div class="int-box precio">
 <h4>Precio</h4>
  <table width="100%" border="0">
   <tr>
    <td><input type="checkbox" id="ubi1" rel="30" onclick="filtrarPrecio();" /><label for="ubi1">US$30</label></td>
   </tr>
   <tr>
    <td><input type="checkbox" id="ubi2" rel="60" onclick="filtrarPrecio();" /><label for="ubi2">US$60</label></td>
   </tr>
   <tr>
    <td><input type="checkbox" id="ubi3" rel="90" onclick="filtrarPrecio();" /><label for="ubi3">US$90</label></td>
   </tr>
   <tr>
    <td><input type="checkbox" id="ubi4" rel="120" onclick="filtrarPrecio();" /><label for="ubi4">US$120</label></td>
   </tr>
 </table>
</div> 
y el .js es este

Código HTML:
    function filtrarPrecio()
    {
        $('div.precio').delegate('input[type=checkbox]', 'change', function()
        {
            var $lis = $('#results > li'),
            $checked = $('input:checked');

            if ($checked.length)
            {
                var selector = $checked.map(function ()
                {
                    return '.' + $(this).attr('rel');
                }).get().join('');
    
            $lis.hide().filter(selector).show();
            }       
            else
            {
                $lis.show();
            }
        });
    }
En este caso lo voy a filtrar por precio, también tengo uno por destino pero este es el mas importante la cosa es que lo quiero hacer con rango de precios pero no me resulta... espero si me dan una mano con esto

Gracias!