Created
September 27, 2013 13:48
-
-
Save dcporter/6728858 to your computer and use it in GitHub Desktop.
Fun With Transitions: ImageView that fades in on load.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
View Transitions, new in SC1.0, have made all kinds of effects drop-dead easy. Here's | |
an ImageView which will fade nicely in when the image loads. | |
*/ | |
FadingImageView = SC.ImageView.extend({ | |
isVisible: NO, | |
isVisibleBinding: SC.Binding.oneWay('.status').transform(function(status) { return status === SC.IMAGE_STATE_LOADED; }), | |
transitionShow: SC.View.FADE_IN, | |
transitionShowOptions: { duration: 0.25 }, | |
transitionHide: SC.View.FADE_OUT, | |
transitionHideOptions: { duration: 0.25 }, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment