Skip to content

Background position limits#17

Open
juliangut wants to merge 2 commits intokentor:masterfrom
juliangut:master
Open

Background position limits#17
juliangut wants to merge 2 commits intokentor:masterfrom
juliangut:master

Conversation

@juliangut
Copy link
Copy Markdown

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
Copy Markdown
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