-
Notifications
You must be signed in to change notification settings - Fork 122
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
Updating zoom source during an active zoom #42
Comments
Hmm… interesting use case. So you basically want it to act like a live viewfinder? How often are you updating the zoom source? I think the biggest issue here would be image load times, unless they're all already cached somehow. Thoughts? |
I draw the video image to a canvas every 100ms to a second, so only one image is ever in play. Then I execute a toDataURL functon on the canvas to change what data-zoom is using. |
I guess another question is how to toggle the Drift on and off. Thanks |
Ah, so it's all local data. That makes things easier. I'm thinking I might just add a public API method for this. How does something like this sound to you? EDITED: var drift = new Drift(whateverSourceElement, {
paneContainer: whateverContainerElement
});
function updateImage() {
// draw to the canvas etc here
drift.updateZoomImage();
} |
I edited the above example, so you should click through to the thread to see that. Whoops! |
drift.updateZoomImage(); sounds exactly like what I would need. The other thing is that I click a zoom button to enable and disable zoom. Any idea on the best way to disable the Drift? |
I suppose I should probably add that, as well. 🙂 I should be able to tackle these next week! |
Hey @a2rampal, thanks for your patience on this! I've added + released as 0.4.0. |
Hi Can anyone help me on this issue ? updateZoomImage doesn't work properly in Mozilla Firefox. It happens when we use different image urls for setting src and data-zoom |
Hey @RosemolJ, can you set up a CodePen (or similar) showing this issue in action? |
Not sure if there is already a way to do this, but I am building an application where I am constantly changing the image that data-zoom is referring to. Essentially zooming on a video and using the screenshots as the zoom source.
Problem I am running into is that every time I have mouseover on the element (video), the zoom image is the screenshot from the time at the start of the mouseover. If I move off the element and come back, the image has been updated.
The text was updated successfully, but these errors were encountered: