Thanks for the help! I nailed it with the following:
$('.todo_item h2').live('click', function() {
clicks++;
x = $(this);
if (clicks == 1) singleClick = setTimeout(function() { clicks
= 0; showExtra(x); }, 300);
if (clicks == 2) { clearTimeout(singleClick); clicks
in the double click function you'd have to clearTimeout on the first
function otherwise it will run anyways.
readysalted wrote:
I'd use this approach -
var clicks = 0;
$('.todo_item h2').live('click', function() {
// count the click
click++;
// only set the timeout
I'd use this approach -
var clicks = 0;
$('.todo_item h2').live('click', function() {
// count the click
click++;
// only set the timeout if the first click to prevent multiple
firing
if( click == 1) setTimeout( "doTheAction()", 300);
});
function doTheAction()
3 matches
Mail list logo