-1
I have a little problem with my script that I can’t fix. I have a function that disables Hover and I also want you to enable Hover. Already managed to disable but now I can’t enable.
Here is the code:
function adicionarBotao(){
$('.collapseMenu').parent('.menuItem').off('mouseenter mouseleave');
$('.collapseBotao').remove();
var botao = '<button class="collapseBotao">dasds</button>';
var numeroDeBotoes = $('.collapseMenu').parent('.menuItem').children('.collapseBotao');
console.log(numeroDeBotoes.length);
if(numeroDeBotoes.length == 0){
$('.collapseMenu').parent('.menuItem').prepend(botao);
}
}
I cheated on myself. Thank you
– Jorge Ferreira
When I give refresh is not returning 0
– Jorge Ferreira
What I have to do?
– Jorge Ferreira
Already solved. When I enter the function delete all buttons
– Jorge Ferreira
But now you can’t click the buttons.
– Jorge Ferreira
I’ve already refilled it
– Jorge Ferreira
You disable events with
.off()
... to enable again, you need to call again the code that enables, type$("elemento"). on("mouseenter")... etc...
.– Sam