Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The placeholder will not move correctly when container is manually scrolled. #31

Closed
bjggzxb opened this issue Jul 27, 2013 · 5 comments
Closed

Comments

@bjggzxb
Copy link

bjggzxb commented Jul 27, 2013

Hey, Jonny.
Thanks for your plugin first, I really like it.

Maybe it is an asked question, but it really confused me.

I'm handling a long list, I want to move the item from beginning to end, so I bind 'mousemove' listener and manually scroll the container.

But the placeholder will not update with the 'scroll', it just stays. I think maybe I should also update the position of the placeholder manually, so I read the source code but still could not figure it out.

Could you tell me is there a way to scroll and update the placeholder?

@johnny
Copy link
Owner

johnny commented Jul 31, 2013

Damn, I deleted my comment. Did you get, what I wrote?

The short version is, you need to customize onDrag. See http://johnny.github.io/jquery-sortable/#connected for an example.

If you post your solution, I will make an example out of it.

@GomZik
Copy link

GomZik commented Jul 31, 2013

I've got answer on my email.

Quote:
The best place would be to hook into the onDrag function, which gets called on mousemove. It defaults to

function ($item, position, _super) {
$item.css(position)
}
position holds the value to set the absolutely positioned $item. See http://johnny.github.io/jquery-sortable/#connected for a custom onDrag function.

Please report back if this worked for you. If you get this working, could you post your solution in this thread? I would be willing to add an example with this behaviour.

@johnny
Copy link
Owner

johnny commented Jul 31, 2013

Thanks for rescuing that!

@bjggzxb
Copy link
Author

bjggzxb commented Jul 31, 2013

OK, I got the point!

I will have a try.

Thanks for your help!

@johnny
Copy link
Owner

johnny commented Feb 19, 2014

duplicate of #67, closing since there is a proposed solution

@johnny johnny closed this as completed Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants