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

Background position limits #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

juliangut
Copy link

Problem

Fully move background image within container limits.
Using "bound: false" and "background-repeat: no-repeat" you can move the image out of sight.

Solution

Limit background movement to prevent getting out of sight.
Additionally adding an inner frame to constraint how close to the borders can the background get, allowing the image to be always be visible at least those pixels

Implementation

New option "frame" indicates number of pixels to limit background movement. Only used when "bound: true"
Frame option is best viewed with "background-repeat: no-repeat"
Calculate boundaries for background position when "bound: true" and a frame is provided so you can move background freely inside container boundaries limited by frame.

Extra

The ability to trigger drag from inner elements (in the example from <p> elements) is desirable in some situations. Added a "propagate" option for this

@juliangut
Copy link
Author

It's been months since @bcole808 and my PR (January) so sorry to ask this but, are you still managing this library?

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

Successfully merging this pull request may close these issues.

1 participant