新窗口拖放

时间:2014-04-02 16:55:36

标签: javascript drag-and-drop target

所以如果我有这个http://jsfiddle.net/sPbmM/93/我怎么能在新窗口中打开?

$('.drag').draggable({
                revert: "invalid",
                helper: "clone"

            });
$('.cart ').droppable({
       accept: ".drag",

    drop: function(event, ui){       
        window.location=$(ui.draggable).find("a.addtocart").attr("href");
    }
});

我尝试了window.open.attr("href","target","_blank"),但我认为sintaxis不正确 谢谢!

1 个答案:

答案 0 :(得分:0)

问题是我使用window.open=...

window.open($(ui.draggable).find("a.addtocart").attr("href"));

DEMO