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'
});
精彩评论