Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-20-2012, 06:24 PM   PM User | #1
angelali
Regular Coder

 
Join Date: Sep 2011
Posts: 310
Thanks: 23
Thanked 0 Times in 0 Posts
angelali is an unknown quantity at this point
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/
angelali is offline   Reply With Quote
Old 11-20-2012, 06:47 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
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.
devnull69 is offline   Reply With Quote
Old 11-20-2012, 06:49 PM   PM User | #3
angelali
Regular Coder

 
Join Date: Sep 2011
Posts: 310
Thanks: 23
Thanked 0 Times in 0 Posts
angelali is an unknown quantity at this point
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.
angelali is offline   Reply With Quote
Old 11-20-2012, 08:25 PM   PM User | #4
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
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
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:49 PM.


Advertisement
Log in to turn off these ads.