日期:2014-05-16 浏览次数:20405 次
<html>
<head>
<title>test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var tir=0;
$('img').mousedown(function() {
clearTimeout(tir);
tir = setTimeout(function() {
alert('ok');
}, 2000);
}).mouseup(function() {
clearTimeout(tir);
});
});
</script>
</head>
<body>
<img src="http://www.google.com.hk/images/srpr/logo4w.png" alt="" />
</body>
</html>