Skip to content
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

Use visibility to hide element from pointer events #57

Merged
merged 1 commit into from
Oct 21, 2015
Merged

Use visibility to hide element from pointer events #57

merged 1 commit into from
Oct 21, 2015

Conversation

daviddarnes
Copy link
Contributor

Re: https://css-tricks.com/snippets/css/toggle-visibility-when-hiding-elements/

Basically I used Wallop, it was awesome, but I couldn't select the content of the currently viewed item. I used visibility: hidden to hide the element. This means the user can interact with the currently viewed item but still allow the item to transition to the next item.

Fixes #56 and #54.

@peduarte
Copy link
Owner

Thanks, will take a proper look.

@daviddarnes
Copy link
Contributor Author

@peduarte no problem. After closer inspection I thought it might not work as I've only applied the hidden state in the keyframe animations, but it appears to work fine ¯_(ツ)_/¯

@peduarte
Copy link
Owner

That's what I was thinking.
I will take a proper look at the fade file.
I originally wrote it thinking it'd be used more as a slideshow, containing only an image and therefore not needing any interaction.
Seems like a lot of people's use case is different.

It's a matter of getting the right z-index.

You should have the same problem if you use the scale animation, I guess?

@daviddarnes
Copy link
Contributor Author

@peduarte possibly, I haven't tried that animation type yet.

I can understand your use case. The problem with it is that it's too good! Users, like myself, are using it for more than just images and you didn't expect it to be used in such a complex way.

I think the z-index ordering is fine how you have it, it just need to hide the element from pointer events which visibility should cover. I'm using the fix and it's working ok.

@peduarte
Copy link
Owner

That's a good point.
I prefer not to add "non-animatable" preterites in keyframes to be honest.
But will keep this PR in mind for sure.

@daviddarnes
Copy link
Contributor Author

@peduarte that seems fair, however the linked article actually shows you can animate visibility. You just need the opacity to make is smooth.

@peduarte
Copy link
Owner

after some research...

visibility animates despite the CSS Basic Box Model spec saying “Animatable: no”

interesting!

@daviddarnes
Copy link
Contributor Author

@peduarte pretty cool ay! But shhh, the spec might hear you and change its mind 😉.

peduarte pushed a commit that referenced this pull request Oct 21, 2015
Use visibility to hide element from pointer events
@peduarte peduarte merged commit 702771a into peduarte:master Oct 21, 2015
@peduarte
Copy link
Owner

Merged, thanks man!

@daviddarnes
Copy link
Contributor Author

No no, thank you! Also, thank you for making this Pen http://codepen.io/peduarte/pen/bVbZLK?editors=001 💜

@daviddarnes daviddarnes deleted the patch-1 branch October 21, 2015 16:05
@peduarte
Copy link
Owner

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants