CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   JQuery draggable does not work (http://www.codingforums.com/showthread.php?t=282642)

angelali 11-20-2012 06:24 PM

JQuery draggable does not work
 
I am having issue in drag and drop in JQuery, here the link, the div is not dragged:

http://jsfiddle.net/FZrZk/

devnull69 11-20-2012 06:47 PM

You'll have to move the call to .draggable() into a $(document).ready() handler so that the DOM has been loaded before you try to access DOM elements.

angelali 11-20-2012 06:49 PM

thank, it works. another issue, i want to set the contenteditable to ON so that I can write. but it seems after set it to ON, i still cannot write. Before I made it draggable, it did work. but now not.

devnull69 11-20-2012 08:25 PM

The .draggable() will "hijack" the click event, therefore the contenteditable still works but not when clicking on the DIV. It will still work when you tab to the element, though.

Workaround: Introduce a drag-handle element to the draggable, so that you can only drag the element with the handle. Then the contenteditable element of the draggable will still react on click


All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.