Jump to content

jQueryUI draggables: revert removes draggability


shadowayex

Recommended Posts

I have this HTML:

	<div class="one">		<div class="box"><p>I am a box</p></div>		<div class="box"><p>I am a box</p></div>		<div class="box"><p>I am a box</p></div>		<div class="box"><p>I am a box</p></div>		<div class="box"><p>I am a box</p></div>		<div class="box"><p>I am a box</p></div>	</div>	<div class="two"></div>

This CSS:

	div.one	{		border: 1px solid black;		float: right;		min-height: 200px;		width: 45%;	}	div.two	{		border: 1px solid black;		float: left;		min-height: 200px;		width: 45%;	}	div.box	{		border: 1px solid black;		float: left;		height: 40px;		margin: 5px;		padding: 5px;		width: 40px;	}

And this Javascript/jQuery:

	$(document).ready(function()			{				$("div.box").draggable({					appendTo: "body",					helper: "clone",					revert: "invalid"				});			}	);

When I drag a .box, the above code will always revert it, as there's no valid placement yet. When the box is reverted, however, the ui-draggable class is removed, and the box can no longer be dragged. I'm using jQuery 1.5 and jQuery UI 1.8.4, but I tried it with the Google API's jQueryUI 1.8.12 and got the same issue.Is there something I've done wrong?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...