Allow moving the panorama using touch events and add autorotation#1
Open
quelbs wants to merge 19 commits intomahonnaise:masterfrom
Open
Allow moving the panorama using touch events and add autorotation#1quelbs wants to merge 19 commits intomahonnaise:masterfrom
quelbs wants to merge 19 commits intomahonnaise:masterfrom
Conversation
- added touchstart, touchmove and touchend events to allow moving the image on touch devices. Additional adjustment of receiving pageX values was required.
- reset the dampingFactor to default value if out of range
Added new option autorotation to allow initial rotation. Hint: to prevent slowdown of rotation set dampingFactor to 1.
Apply cyclotron to all objects with class cyclotron on load.
To allow non continuous images that stop at the border the new option continuous checks the offset when set to 0 and prevents scrolling beyond the image border.
Author
|
I did some more improvements including adding an autorotation option and a continuous option |
|
This is fantastic! Works like a dream for me... |
Thank you MarcaTyron for your hint to improve compatibilty with other scripts by replacing $ with jQuery
Use same license as main origin.
- if autorotation is active and non continuous is selected turn around on the image border
In case of images resized by background-size calculate the width with getBackgroundWidth function
- Use .one load handler to determine max value always after the image is loaded - change .bind to .on for compatibility - prevent usage of $, prefer jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added touchstart, touchmove and touchend events to allow moving the image on touch devices. Additional adjustment of receiving pageX values was required.