I have some dependencies issue where jQuery i cant use but at the same time i need to make this work, any idea how you can do this without jQuery libraries.
$(document).ready(function() {
function after2SecPreset1() {
$('#sptouchscreen').hide();
return ;
}
function before2SecPreset1() {
console.log('before2secpreset1');
}
var clickstart;
var clickstop;
$('#sptouchscreen').on('mousedown', function(e) {
clickstart = e.timeStamp;
}).on('mouseup', function(e) {
clickstop = e.timeStamp- clickstart;
if(clickstop >= 2000) {
after2SecPreset1();
} else {
before2SecPreset1();
}
});
});