-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Problem with the Trigger Hook #148
Comments
Update: I tried pasting my own code in jsfiddle but it works no matter how large the height of the spacer is. But in my local, the trigger hook is still off screen. What could be the problem? |
First please confirm terminology: Are you using the ScrollMagic debug extension? The triggerHook is the blue mark on the right. Are you sure it moves? Or does in fact the scene's start position move? |
Oh, here's a guess if the spacer indeed changes the position of the triggerHook it might be because it changes the size of the scroll container. |
Thanks for the response! I'm using both the scrollmagic and scrollmagic debug extension. Like what I've said, in jsfiddle it is initially centered (I assume it is the default). |
The problem is that whichever height I change, be it the container or the spacer, the triggerHook's position changes. Most of the time it is off-screen when the height is greater than the screen's height. |
Okay: Again my guess is that you use a custom container element and the change of the spacer influences the height of the container. So please check if changing the height of your spacer also influences the height of your container and get back to me. |
Thanks for replying. I'll check my work tonight 'cause I'm not in my workstation now. But correct me if I'm wrong, the container target of the triggerHook is the parent of the element you set as the triggerElement and this parent element will be divided by two? |
No. The container is the element you supply as the container option when initializing the controller. |
Oh, now I get it. And you're correct. I've used a custom container: As you can see, I changed the spacer's height. It didn't affect the container's height. Fortunately, I got it now. I've set the container's height to 100% so that it will inherit the window's height. In that case, the triggerHook will be placed at the center throughout the page. Thank you for enlightening my muddled mind! |
glad I could help. |
Good day!
I'm trying to make the simple tween example but I'm stuck with this problem. I have a spacer section before my trigger div and box div (the one that will be animated). Everytime I set the spacer height to like greater than the screen's height, the trigger hook will not be on the center anymore but it's in the bottom of the screen (sometimes off-screen). Why does this happen?
Thank you in advance.
The text was updated successfully, but these errors were encountered: