I have looked at this thread (http://groups.google.com/group/jquery- dev/browse_thread/thread/e98a3108ab7fc930?hl=en#) which explains the same issue, but applying the same fix to my local copy of jQuery UI 1.6rc6, does not resolve my issue.
Strangely, the event does get 'passed' on but the dragging is still not fired. This is the case with the normal mousedown event, the mousedown.draggable namespaced event does not fire at all. See the example below: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <title>Dragging Trigger</title> <script type="text/javascript" language="JavaScript" src="jquery.js"></script> <script type="text/javascript" language="JavaScript" src="jquery.ui.all.js"></script> <script type="text/javascript" language="JavaScript"> jQuery(document).ready(function() { jQuery("#myDiv").mousedown(function(ev) { target = jQuery(ev.target); target.draggable({ helper: "clone", start: function() { console.log("drag start"); }, stop: function() { jQuery(this).draggable("destroy"); } }).trigger("mousedown.draggable", [ev]); }); jQuery("#draggableDiv").draggable({ helper: "clone" }); jQuery("#fireDragDiv").bind("click", function(eventData) { jQuery('#draggableDiv').triggerHandler("mousedown", eventData); }); jQuery("#draggableDiv").bind("mousedown", function() { console.log ("Mouse down handler was fired " + new Date().getTime()); }); }); </script> <style type="text/css"> #myDiv .drag-me { margin: 5px; width: 20px; height: 20px; background-color: red; } #fireDragDiv { width: 50px; height: 50px; background-color: blue; } #draggableDiv { width: 50px; height: 50px; background-color: green; } </style> </head> <body> <div id="myDiv"> <div class="drag-me"></div> <div class="drag-me"></div> <div class="drag-me"></div> <div class="drag-me"></div> <div class="drag-me"></div> <div class="drag-me"></div> <div class="drag-me"></div> </div> <div id="fireDragDiv"> </div> <div id="draggableDiv"> </div> </body> </html> On Feb 6, 12:18 pm, Neil Craig <[email protected]> wrote: > I have downloaded the trunk and built it using ANT. But alas it will > not work, now it gives "too much recursion errors"...... > > On Feb 6, 8:41 am, Neil Craig <[email protected]> wrote: > > > Thanks, getting the latest trunk now.... > > > On Feb 5, 2:59 pm, "Richard D. Worth" <[email protected]> wrote: > > > > This was fixed in trunk last night. > > > >http://dev.jqueryui.com/ticket/4061 > > > >http://dev.jqueryui.com/changeset/1997 > > > > - Richard > > > > On Thu, Feb 5, 2009 at 6:24 AM, Neil Craig <[email protected]> > > > wrote: > > > > > In the previous versions of jQuery & jQuey-UI, one could trigger > > > > dragging like so: > > > > > jQuery(document).ready(function() { > > > > > jQuery("#myDiv").mousedown(function(ev) { > > > > > target = jQuery(ev.target); > > > > > /* Various logic that sets the draggable variable to > > > > either > > > > true or > > > > false */ > > > > > if (draggable) { > > > > target.draggable({ > > > > helper: "clone", > > > > stop: function() > > > > { > > > > > > > > jQuery(this).draggable("destroy"); > > > > } > > > > }).trigger("mousedown.draggable", [ev]); > > > > } > > > > }); > > > > > }); > > > > > But it will not work, javascript reports the following error: > > > > "event.originalEvent is undefined". > > > > > How can I fix this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
