Does anyone know why this code might not work? touchmove and touchend do not execute only touchstart because that’s a seperate event and function 🙂
$('input').live("touchstart", function (e) {$(this).addClass('click')});
$('input').live("touchmove,touchend", function (e) {
if (e.type == 'touchmove'){
$('.temp').removeClass('temp');
$('.click').removeClass('click');
}
else{var inputvalue = $(this).val()
$('input[value="' + inputvalue + '"] + label').css({
'-webkit-transition': 'opacity 0.3s linear',
'opacity': '0'
});
setTimeout(function () {
$('input[value="' + inputvalue + '"] + label').css({'-webkit-transition': '0','opacity': '1'});
$('.temp').removeClass('temp');
$('.click').removeClass('click');
}, 300);}
});
Thanks a lot for any attempt 🙂
The event names in the first argument to “.live()” need to be separated by spaces, not commas.