JS:
function handDrag(dragHand)
{
if(dragHand ==true)
{
//live query to auto bind the drag function to all elements of the cardsHand class even auto generated ones
$('#playerHand')
.livequery('mouseenter', function(e){
$('img.playerCardsHand').draggable
({
zIndex: 1000,
revert: 'invalid',
stack: '.playerCardsHand',
selectedCard: 'widget',
addClasses: 'false',
disabled : false
});
});
}
else
{
$('img.playerCardsHand').draggable({ disabled: true });
}
}
function swapCards()
{
handDrag(true);
}
function ready()
{
handDrag(false);
}
Basically I call swapCards() I want to be able to drag my cards around the screen and drop them.
I then hit ready and it calls the ready() method. I then want my cards to no longer be draggable.
However now it keeps them draggable. I have tried removing the disabled: false to the swapCards draggable initialization but when I do that when I try and re-enable the draggable using
handDrag(true);
it won't re-enable the dragging.
Any ideas?