开发者

Drag and Drop w/ jscrollpane dragging out of the scroll pane

开发者 https://www.devze.com 2023-04-12 14:45 出处:网络
Curious if anyone has added drag and drop functionality to jscroll开发者_如何转开发pane? I\'m looking to drag a div (inside jscrollpane) and drop it in a div outside the jscrollpane and have it rever

Curious if anyone has added drag and drop functionality to jscroll开发者_如何转开发pane?

I'm looking to drag a div (inside jscrollpane) and drop it in a div outside the jscrollpane and have it revert back to the source.

Right now with overflow hidden you can't drag outside of the jscrollpane window.


I had this same issue. My page consists of a list of tags on the left inside a jScrollPane and images on the rest of the page that you drag the tags to. The tags are draggables form jQuery Ui. I wasn't able to drag the tags outside the scroll pane because of the overflow:hidden that is necessary to make it work.

But here's a workaround if you're using jQuery Ui (you didn't specify): You can use a helper element and append it to the body (because it's outside the scroll pane). This creates a copy of the element and that is what you drag. This gives sufficient visual feedback to the user. I can't figure out a way to make it so you can drag the actual element, but this works:

$( ".selector" ).draggable({ 
    helper: 'clone' ,
    appendTo: 'body'
});
0

精彩评论

暂无评论...
验证码 换一张
取 消