Problem w/ 2 lists with 2 different styles

Nov 10, 2011 at 4:14 PM

I'm using dragsort to create a shopping cart of sorts, so I have two different lists each with their own CSS styles as seen here:

http://www.joetito.com/dragdrop/app-store.php

The problem I'm running into is that if an item is dragged from one list to the other, the alignment of items gets messed up because it's using the height/width of the dragged item instead of the height/width of the placeholder style within the destination list.

How can I change the library to use the style of the placeholder div within the list that is currently being hovered over?

Coordinator
Nov 27, 2011 at 4:57 AM

In the dragSort code you can find and change this line to remove setting the height and width:

list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeHolder", true);
Good job on the page, looks like you've put a bit of work into it.

Nov 28, 2011 at 2:18 PM
mcm_ham wrote:

In the dragSort code you can find and change this line to remove setting the height and width:

list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeHolder", true);
Good job on the page, looks like you've put a bit of work into it.

 

Thanks mcm_ham!

I changed this line:

list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeHolder", true);

to this:

list.placeHolderItem = list.draggedItem.next().attr("data-placeHolder", true);

and everything worked perfectly!