Jump to content

Droppable Problem


adam84

Recommended Posts

Hi, I am having trouble getting the Droppable to work correctly. With the code I have provided, what happens is when I drag my 'task' over to the 'Tuesday DIV', it automatically returns to the 'Monday DIV', where it started. What I want to achieve is to have the task move if they drag it into the 'Tuesday DIV', if its anywhere else, I want it to go back to the location it started at. Any guidance, what I am missing to get this to work?

 

My Javascript


		$(function() {
			$( "#task" ).draggable({ revert: "invalid" });


			$( "#tuesdayDIV" ).droppable({
					accept: "#task",
				activeClass: "ui-state-hover",
        				hoverClass: "ui-state-active",
				drop: function(){
					   var targetElem = $(this).attr("id");
            						$( this )
                					.addClass( "ui-state-highlight" );
				}     				
			});
		});

 

My HTML

				<div name="mondayDIV" id="mondayDIV" class="droppable ui-widget-header">
					<div name="task" id="task" class="ui-widget-content"><p>
						<div class="soNumber"> 16523</div>
						<div class="soTime">5.00 hrs </div></p>
					</div>
				</div>

				<div name="tuesdayDIV" id="tuesdayDIV" class="droppable ui-widget-header">
				</div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.