Hello,
I wonder why the toggle event is being fired twice when clicked. This is my code and it outputs the console.log twice each case:
$('.toggle').on('toggle', function(e, active) {
if(active)
console.log("Aktiv!" + active);
else
console.log("Inaktiv!" + active);
})
I noticed that if the user completely swipes the toggle element it is only being fired once. I just want to do ONE MySQL query once the state has changed, how would I do so?
Hello,
I wonder why the toggle event is being fired twice when clicked. This is my code and it outputs the console.log twice each case:
I noticed that if the user completely swipes the toggle element it is only being fired once. I just want to do ONE MySQL query once the state has changed, how would I do so?