i'm trying to test if the mouse is down or not so using mousedown() i try to set the value of down to true, but that never happens.
Heres the code
function checkDown()
{
var down = false;
$(document).mousedown(()=>{down = true;});
return down;
}
move down in global and event listener to the global;
var down = false; // by default will be false
$(document).mousedown(()=>{down = true;});// when mouse will be down it will make it true
function checkDown()
{
return down;// returns the current status of down
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments