2
Can anyone tell me, how do I hide a div when show another?
I have a hidden div that only shows on receiving a condition. I wish that when this hidden div received the condition and appeared, hide another div.
However, there is no button action in this case. Upon entering the page, the visitor who has not chosen anything previously, will find a warning and in this case, would like to hide another warning that is always open.
Ex.: Condition Div1 visible at all times. Div2 is always hidden.
When entering the page; Div1 (remains visible) would like to hide it. Visible div2.
DIV ALWAYS VISIBLE
<div id="AvisoCar">
<div class="AvisoCarrinho">** AVISO IMPORTANTE **</div></div>
DIV THAT ONLY APPEARS WHEN THE CART IS EMPTY:
<div class="ValorTotalComp">
TOTAL + FRETE: R$ <?=toReal((isset($_SESSION['LOJA_DEFAULT']['VALOR_FRETE'])?$_SESSION['LOJA_DEFAULT']['VALOR_FRETE']:0)+$totCompra)?> <? }
else { echo "**<div class='AvisoSacolavazia'>Sua sacola está vazia</div>**"; }?>
</div>
I wish that when the "Your Bag is empty" notice appears on the page, hide the div
Without having to take action from any button.
I tried to do it through echo, but to no avail.
I don’t understand, which is the div2 and which is the div1? You have a div inside another, if you hide the div "father" the other will disappear too.
– mau humor
This div is always visible. <div id="Note"><div class="Note">** IMPORTANT NOTICE **</div>
– Biel
This only appears when the cart is empty. <div class="Total valueOffice"> TOTAL + FREIGHT: R$ <?=toReal((isset($_SESSION['LOJA_DEFAULT']['VALOR_FRETE'])?$_SESSION['LOJA_DEFAULT']['VALOR_FRETE']:0)+$totCompra)? > <? } Else { echo "<div class='Noteempty'>Your bag is empty</div>"; }? > </div>
– Biel
I would like to hide the div Avisocar when the div Avisosacolavazira appears
– Biel
Edit the question and enter this information, it is better.
– mau humor
Put in the full code, and not just what’s in Else.
– mau humor