可拖动动作时为什么层弹出窗口会增加?

时间:2018-11-22 08:24:17

标签: javascript user-interface jquery-ui popup draggable

var position = {
    top: (jQuery(window).Height / 2 - popup.outerHeight()/2) +jQuery(window).scrollTop(),
    left: jQuery(window).Height / 2 - popup.outerWidth()
}

popup.css("top", position.top+"px");
popup.css("left", position.left+"px");

popup.draggable({
    containment : jQuery("#popupPosition"),
    handle : handle,
    stop : function(e, ui) {

    },
    start : function(e, ui) {
        ui.position = ui.offset;
        var id = ui.helper.attr("id");
        changeZIndex(JBCode.POPUP.COMMON.NAME, id);
    }
});
handle.css("cursor", "move");

Console Screen Shot

popup是图层弹出窗口的DIV,当我移动弹出窗口时,它会向上移动而没有+jQuery(window).scrollTop()值。

当我在开始选项ui上检查ui.offset对象是正确的值,但是ui.positionui.originalPositionui.offset不同且值没有{{1 }}

为什么会这样?我该如何解决?

0 个答案:

没有答案