3

Whenever you attempt to drag an image that you need to scroll down to see (anything not visible on first load) the image gets shot up to the top of the page instead of staying with the cursor. This only happens in Chrome or Safari, works great in Firefox. I've tried methods outside of Draggable to fix this issue, but they just lead to additional problems.

Here's the simplest version of the desired code, I just can't find the right classes to use, but the answer must be somewhere here

 $( "img" ).draggable({ stack: "img" });

I believe it's using jquery-ui-1.10.0.custom.min.js for the drag function.

Here is the URL it's being tested at: http://julian-berman.com/test/2/

So pretty much it doesn't know how to readjust the Y placement of an image outside of the initial window container, and I can't for the life of me figure out how to make that happen.

4

1 に答える 1

0

画像の位置を からrelativeに変更するとabsolute役立ちます。しかし、ドラッグ可能にするのは画像ではなく、その親 div にする必要があると思います。そう:

$(".photo").draggable({ handle: "img", stack: ".photo" });
于 2013-03-17T23:14:16.027 に答える