I have the following code:
$("#accion_stock_remove").click(function(){
if($("#accion_stock_remove").is(':checked')){
$("#stock_roto_yes").removeClass("hidden");
$("#stock_roto").slideDown("slow");
$("#stock_roto").attr("disabled",false);
$("#stock_noroto").attr("disabled",false);
}
});
$("#accion_stock_add").click(function(){
if($("#accion_stock_add").is(':checked')){
$("#stock_roto_yes").addClass("hidden");
$("#stock_roto").attr("disabled",true);
$("#stock_noroto").attr("disabled",true);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="col-md-6">
<input type="radio" class="hidden checkBox" name="accion_stock" id="accion_stock_add"/>
<label for="accion_stock_add" class="checkBoxLabel" style="width: 100% !important">Añadir</label>
</div>
<div class="col-md-6">
<input type="radio" class="hidden checkBox" name="accion_stock" id="accion_stock_remove"/>
<label for="accion_stock_remove" class="checkBoxLabel" style="width: 100% !important">Quitar</label>
</div>
<div class="row hidden" id="stock_roto_yes">
<div class="col-md-12"><center>ES STOCK ROTO?</center></div>
<div class="col-md-6">
<input type="radio" class="hidden checkBox" name="stock_roto" id="stock_roto" value="roto" disabled/>
<label for="stock_roto" class="checkBoxLabel" style="width: 100% !important">SÍ</label>
</div>
<div class="col-md-6">
<input type="radio" class="hidden checkBox" name="stock_roto" id="stock_noroto" value="noroto" disabled/>
<label for="stock_noroto" class="checkBoxLabel" style="width: 100% !important">NO</label>
</div>
</div>
What I need is that when you click on the Quitar
button it displays an animation slideDown()
the div stock_roto_yes
and when you click on Añadir
that closes with an animation slideUp()
but does not It works, and the inspector's console does not tell me there is an error either.