views:

177

answers:

0

trying to create my droppables based on the object being dragged. the drag works fine, but the droppables are not being created. there also aren't any errors in the error console. any help?

JS:

$("#theSchedule, #theExtras").live('mouseover', function () {
    $(".curSelected").draggable({
        helper: 'clone',
        opacity: 0.50,
        appendTo: 'body',
        zIndex: 4,
        addClasses: false,
        start: createDrops,
        stop: tooltip
    });
}).live('mouseout', function (e) {
    $(".curSelected").draggable('destroy');
});

function createDrops(ev, ui){
    disableTip();
    if($(ui.helper).hasClass("even")){
        $(".even, .evenExtra").droppable({
            accept: ".curSelected",
            addClasses: false,
            hoverClass: 'dropHover',
            drop: moveJob
        });
    } else {
        $(".odd, .oddExtra").droppable({
            accept: ".curSelected",
            addClasses: false,
            hoverClass: 'dropHover',
            drop: moveJob
        });
    }
}
function tooltip() {
    xOffset = 60;
    yOffset = 50;
    $("a.tooltip").live('mouseover', createTip).live('mouseout', killTip);
    $("a.tooltip").live('mousemove', function (e) {
        $("#tooltip").css("top", (e.pageY - xOffset) + "px").css("left", (e.pageX + yOffset) + "px");
    });
};
function disableTip() {
    $("a.tooltip").die('mouseover', createTip).die('mouseout', killTip);
    $("#tooltip").remove();
}
function moveJob(eventt, ui) {
    var job = ($(ui.draggable).attr("id"));
    var spot = ($(this).attr("id"));
    //alert(job+', '+spot);
    $.ajax({
        type: "GET",
        data: "func=moveJob&jobNum=" + job + "&move=" + spot,
        url: "../resources/classes/controller_TEST.php",
        error: moveJobError,
        complete: moveJobCallback
    });
}
function moveJobCallback(response) {
    //alert(response.responseText);
    getSchedule();
}

sample draggable element HTML:

<div id="36636" class="even dragMe curSelected">
    <a class="tooltip" href="print.php?id=36636&which=1" title="Notes: $149 ACT + EFT requiredBoard: see notes" target="_blank" style="z-index: 2;">
        Ricky Desimone
        Hope Valley, RI
        see notes
    </a> 
</div>

sample droppable element HTML:

<div id="2+9-1+2009-11-30" class="even"/>