te falta un hide... (esconder todo al principio)
debes ocultar todo con jquery y en html las clases no pueden ser solo numericas
Código PHP:
<?php
while ($r = $query->fetch_array()) { ?>
<div id="productos">
<div class="filtro f_<?php echo $r["moneda"]; ?>">
<div class="inventory margin-bottom-20 clearfix scroll_effect fadeIn">
<input type="checkbox" name="a" class="checkbox compare_vehicle input-checkbox" id="vehicle_1"/>
<label for="vehicle_1"></label>
<a class="inventory" href="inventory-listing.html">
<div class="title"><?php echo $r["nombre"]; ?></div>
<img src="http://www.forosdelweb.com/f18/images/productos/<?php echo $r["img"]; ?>" class="preview" alt="preview">
<table class="options-primary">
<tr>
<td class="option primary">Body Style:</td>
<td class="spec">Sport Utility Vehicle</td>
</tr>
<tr>
<td class="option primary">Drivetrain:</td>
<td class="spec">4WD</td>
</tr>
<tr>
<td class="option primary">Engine:</td>
<td class="spec">4.8L V8</td>
</tr>
<tr>
<td class="option primary">Transmission:</td>
<td class="spec">8-Speed Tiptronic</td>
</tr>
<tr>
<td class="option primary">Mileage:</td>
<td class="spec">19,585</td>
</tr>
</table>
<table class="options-secondary">
<tr>
<td class="option secondary">Exterior Color:</td>
<td class="spec">Dark Blue Metallic</td>
</tr>
<tr>
<td class="option secondary">Interior Color:</td>
<td class="spec">Black / Titanium Blue</td>
</tr>
<tr>
<td class="option secondary">MPG:</td>
<td class="spec">15 city / 21 hwy</td>
</tr>
<tr>
<td class="option secondary">Stock Number:</td>
<td class="spec">590497</td>
</tr>
<tr>
<td class="option secondary">VIN Number:</td>
<td class="spec">WP1AD29P09LA65818</td>
</tr>
</table>
<img src="http://demo.themesuite.com/automotive/images/carfax.png" alt="carfax" class="carfax"/>
<div class="price"><b>Precio:</b><br>
<div class="figure"><?php if ($r["moneda"] == 1) {
echo "$ " . $r["precio"];
} elseif ($r["moneda"] == 2) {
echo "Cr " . $r["precio"];
} ?><br>
</div>
</div>
<div class="view-details gradient_button"><i class='fa fa-plus-circle'></i> Ver Detalles</div>
<div class="clearfix"></div>
</a>
<div class="view-video gradient_button" data-youtube-id="3oh7PBc33dk"><i class="fa fa-video-camera"></i>
Ver Video
</div>
</div>
</div>
</div>
<?php } ?>
Código Javascript
:
Ver original$(function(){
$('#filtro_moneda').change(function(){
var value = $(this).val();
if (value){
$(".filtro").hide();
$(".f_"+value).show();
}
else{
// Se ha seleccionado All
$(".filtro").show();
}
});
})
usa las clases para ocultar y mostrar y recuerda que en html puedes usar mas de una sola clase.