You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.
I'd rather specify the new position than add or remove pixels from the pan position, which doesn't seem possible to me, so I created the following function to enable this feature.
Feel free to edit and/or integrate.
/**
* panto function accessible via direct call (ex : $('#zoomImage').smartZoom('panto', 5, 0);)
* @param {Number} xPos : a number to move the object current position in X
* @param {Point} yToAdd : a number to move the object current position in Y
* @param {Number} duration : move effect duration 700ms by default
*/
panto : function(xPos, yPos, duration){
if(xPos == null || yPos == null) // check params
return;
if(duration == null) // default pan duration is 700ms
duration = 700;
var currentPosition = targetElement.offset();
var targetRect = getTargetRect();
var validPosition = getValidTargetElementPosition(xPos, yPos, targetRect.width, targetRect.height); // add the given numbers to the current coordinates and valid the result
if(validPosition.x != currentPosition.left || validPosition.y != currentPosition.top){
// stop previous effect before make calculation
stopAnim(ESmartZoomEvent.PAN);
moveOnMotion(xPos, yPos, duration);
}
},
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'd rather specify the new position than add or remove pixels from the pan position, which doesn't seem possible to me, so I created the following function to enable this feature.
Feel free to edit and/or integrate.
The text was updated successfully, but these errors were encountered: