0
I’m doing some tests in javascript
, so that, at the clicar
in a given botão
, one item summed, in another botão
another item sum up, and so on, but none of the botões
works
*They all follow the pattern below, changing only names of id's
$('#btn-1').click(function(){
if($('#imagem-chamada').css('display') != 'none'){
$('#imagem-chamada').addClass('hide');
$('#new-img').addClass('show');
}else{
$('#imagem-chamada').addClass('show');
$('#new-img').addClass('hide');
}
});
*I tried to use the .show()
and .hide()
*I also tried to use the .css('display', 'inline-block/none')
<div id="new-img">
<div class="file" id="image-holder"></div>
<label for="fileUpload">Alterar Imagem</label>
</div>
<div id="imagem-chamada" >
<img class="file" id="src-img">
<label id="btn-1" for="fileUpload">Alterar Imagem</label>
</div>
Can you make a jsFiddle? or create a complete example here that you can test? Not knowing the HTML and CSS of these classes is hard to know what is failing...
– Sergio
discovered the error, it was not in my code, the guy who works cmg using git linked a dps file of mine that used the same Divs, giving a
display inline-block nelas
– Murilo Melo