Jump to content
mimeartist

autoAlpha and full hiding the item...

Recommended Posts

I have a set of images that go horizontally, depending on the category it shows different ones, and you can scroll left to right...

 

the trouble I am having is that when I use autoAlpha on items that have been set with visibility:hidden, when I set autoAlpha to 0 the images never fully disappear... so even if the last visible image was at 2000px you can still scroll to 4000 pixels because there is still an image there, even though it is 'invisible'

 

What is the best way to handle this? set them to display:none after they finished their autoAlpha to 0, or am I missing something?

 

PS I'm learning so much from this forum, so thanks to everyone who has helped me thus far!

 

James

Share this post


Link to post
Share on other sites

Hello.. Do you have a code example so we can see what you are describing?

 

There maybe some other CSS overriding your styles.. so they are not fully displayed. You could try to set display none after the animation.. but i think there is something else that might be causing the autoAlpha:0 element to still be visible.. since with opacity zero and visibility hidden, it should still hide your elements.

 

Is it possible that you could make a codepen demo example, this way we can see your code in action.

 

Video tut by GreenSock on How to create a demo codepen example.

 

Thanks! :)

  • Like 1

Share this post


Link to post
Share on other sites

If you add display:'none' to your autoAlpha tween, display will automatically toggle to 'none' at the very end of the tween. Likewise, if you tween from display:'none' to 'block', or 'inline', the toggle will happen at the very start of the tween.

TweenLite.to(foo, 1, { autoAlpha: 0, display: 'none' });
// fades out then sets display:'none' at the end
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.