Return to Snippet

Revision: 45272
at April 28, 2011 02:39 by Sullan


Initial Code
$('.dataLink').live('click', function(e) {
	var sourceURL = $(this).attr('title');									  
    var that = this;
    setTimeout(function() {
        var double = parseInt($(that).data('double'), 10);
        if (double > 0) {
            $(that).data('double', double-1);
            return false;
        } 
		else 
		{
		alert("single click");	
			$.ajax({
			url: sourceURL,
			timeout: 10,
			processData: false,
			success: function(data) {
			$('#contentBottom').html(data);
			},
			error: function(data) {
			//alert("timed out");
			}
			});	
        }
    }, 300);
}).live('dblclick', function(e) {
    $(this).data('double', 2);
	alert("double click");
	var modalUrl = $(this).attr('rel'); 
	$('.plotter').load(modalUrl).dialog('open');
	return false;
    e.stopPropagation();    
});

Initial URL


Initial Description


Initial Title
Single and Double click event delay

Initial Tags


Initial Language
jQuery