0
I wonder if there’s any way I can present the contents of a div at a certain time. Because in this case I’m inserting an html into the div and after a while I’d like it to disappear, there’s some way to do it?
<div id="alerta">
</div>
@if (cadastradoComSucesso)
{
<script>
var functionSuccess = function () {
$('#alerta').html('<div class="alert alert-success" role="alert"> Registro cadastrado com sucesso.</div>')
};
setTimeout(functionSuccess, 8000);
</script>
}
else
{
<script>
var functionWarrning = function () {
$('#alerta').html('<div class="alert alert-warning" role="alert"> Erro ao salvar registro.</div>')
};
setTimeout(functionWarrning, 8000);
</script>
}
What do you have inside your job? You tried
$().hide
jQuery?– Raizant
So, but in this case, what would I call Hide? I would have to have a timer for that not?
– Nicola Bogar
Your setTimeOut doesn’t do that anymore?
– Raizant
I honestly don’t know how the question was positive, it shows no research effort, since it’s something you should have about 8000 duplicates here in the Stack... a quick
googlada
already gives the answer.– Raizant