/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('.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(); });