Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I style jQuery draggable clone?

How can I style jQuery draggable clone with CSS?

like image 507
newbie Avatar asked Jun 27 '11 07:06

newbie


People also ask

What is jQuery draggable?

Draggable() Method This method allows the elements to be dragged with the help of mouse. Using jQuery UI, we can make the DOM(Document Object Model) elements to drag anywhere within the view port. This can be done by clicking on the draggable object by mouse and dragging it anywhere within the view port.

Why is draggable not working?

You have one of these problems: Your jQuery or jQuery UI Javascript path files are wrong. Your jQuery UI does not include draggable. Your jQuery or jQuery UI Javascript files are corrupted.

Does jQuery draggable work on mobile?

jQuery UI wasn't originally written to handle mobile devices. It won't even play nicely with jQuery Mobile. some parts of it may still work well in mobile devices, but anything that has anything to do with dragging will fail.


1 Answers

Refer to second answer by tohster - this is outdated.

=======

http://webdevel.blogspot.com/2008/09/jquery-ui-draggables-helper-css-class.html this might be a help

Quoting from the above site:

While working with jQuery UI draggables, I have noticed that there does not seem to be a class associated with the draggable helper, and so it is styled in the same way as the draggable you selected. As a result you have to resort to the start function option to add the class dynamically:

$(".dragme").draggable({helper: "clone",  start: function(e, ui)  {   $(ui.helper).addClass("ui-draggable-helper");  } }); 

As a result you have to resort to the start function option to add the class dynamically:

.ui-draggable-helper {  border: 1px dotted #000;  padding: 6px;  background: #fff;  font-size: 1.2em; } 
like image 160
Jayantha Lal Sirisena Avatar answered Sep 22 '22 20:09

Jayantha Lal Sirisena