-
Notifications
You must be signed in to change notification settings - Fork 539
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
Update scrollOffset and scrollDuration on the fly? #35
Comments
Hi Damon, are you talking about pins or regular animations? regards, |
Hi Jan, Forgot to mention that, yes it's for a animation. I saw it was possible for pins. So by "not yet" I assume that you are going to include this in SuperScrollorama? Damon |
Hi Damon, yes, to my mind it is useful for the same reasons I included the updatePin method. regards, |
With responsive sites becoming the norm I think it would be a good addition <= this being the reason I need it :p Though I see it's not 'essential' as most people don't resize their browser, apart from inquisitive developers.. But all the same, I dont want my site to break if they choose to do so. Thanx for replying, |
Hi Damon, If It's solely a vertical positioning issue you should try to work with percentages as left position values. regards, |
+1 for this functionality. Running into the same thing and I'm already using percentages for top and left position values. Any update? |
Hi jlevinsohn, actually I am sorry that I have made no progress in this regard. I just came back from my honeymoon and am quite busy now. I might get around to do it his month, but no promises. :-/ regards, |
Thanks for writing back, Jan. I really appreciate the update. |
Good news, everyone! :) A solution might be near! Check it out: #94 regards, |
Hi Jan, First of all, thanks for your amazing plugin. :) You said above that's possible to Update scrollOffset and scrollDuration on the fly for pinned elements, could you please show some example? Thanks! |
Hi inamine, Do you mean for Superscrollorama or for ScrollMagic? var controller = new ScrollMagic();
var scene = controller.addScene("#trigger", {duration: 400, offset: -200})
.pin("#pinelement"); and then at any point in time you can do this: scene.duration(600); or this: scene.offset(-100); hope this helps! |
Thanks a lot! Regards |
If you tweaked this function to accept an object and then to push that object to the array of tween like it sort of does under the hood. Then in theory if you kept a reference to that object around, you could change the offset on a resize and the tween would auto update. I would imagine you would also need to invoke some sort of auto update function as well, nasty but it would work
|
Is it possible to do that?
My offset and duration is set by the width and height of the window, which works fine. Until the user resizes the browser, which means the offset and duration are now wrong.
At the moment I am calling a function with adds the tweens again but with the new prams. It seems to be working ok, though sometimes the positioning is a little off. I just wondered if this was the correct way of doing it? Is it updating the original instance, or creating new ones?
The text was updated successfully, but these errors were encountered: