Possible Duplicate:
jQuery: Detecting click-and-hold
I am looking for some way to have an img, and when I hold down the image for maybe 1 or 2 seconds, jQuery changes the CSS to "display","block"... I have looked and looked and could not find what I needed. Please give the best answer possible. I'm making a finger scan app...:) Here is the code I have right now:
HTML:
<body>
<img id="testlaser" src="images/Laser.gif">
<div class="fingerprint">
</div>
<img class="access_denied" src="images/AccessDenied.jpg">
</body>
CSS:
<style>
body{-webkit-user-select: none;overflow:hidden;scrolling:no;}
#testlaser{height:100%;width:100%;position:absolute;display:none;}
.fingerprint{display:block;position:absolute;background-image:url(images/fingerprint.gif);background-repeat:no-repeat;background-position:center center;text-align:center;width:100%;height:90%}
.access_denied{display:none;background-position:center center;width:100%;height:100%;}
.access_granted{display:none;background-position:center center;width:100%;height:100%;}
</style>
Java Script:
<script>
$(".fingerprint").click('click mousedown', function(){
$("#testlaser").css("display","block")
$(".fingerprint").css("display","block")
setTimeout(function(){
$("#testlaser").css("display","none")
$(".fingerprint").css("display","none")
$(".access_denied").css("display","block")
},10000);
});
$(".access_denied").click(function(){
$("#testlaser").css("display","none")
$(".fingerprint").css("display","block")
$(".access_denied").css("display","none")
});
</script>