|
27 | 27 | Click me: <input type="checkbox" ng-model="checked"><br/> |
28 | 28 | <div> |
29 | 29 | Show: |
30 | | - <span class="check-element example-show-hide" ng-show="checked"> |
| 30 | + <div class="check-element animate-show" ng-show="checked"> |
31 | 31 | <span class="icon-thumbs-up"></span> I show up when your checkbox is checked. |
32 | | - </span> |
| 32 | + </div> |
33 | 33 | </div> |
34 | 34 | <div> |
35 | 35 | Hide: |
36 | | - <span class="check-element example-show-hide" ng-hide="checked"> |
| 36 | + <div class="check-element animate-show" ng-hide="checked"> |
37 | 37 | <span class="icon-thumbs-down"></span> I hide when your checkbox is checked. |
38 | | - </span> |
| 38 | + </div> |
39 | 39 | </div> |
40 | 40 | </file> |
41 | 41 | <file name="animations.css"> |
42 | | - .example-show-hide { |
| 42 | + .animate-show.ng-hide-add, |
| 43 | + .animate-show.ng-hide-remove { |
43 | 44 | -webkit-transition:all linear 0.5s; |
44 | 45 | -moz-transition:all linear 0.5s; |
45 | | - -ms-transition:all linear 0.5s; |
46 | 46 | -o-transition:all linear 0.5s; |
47 | 47 | transition:all linear 0.5s; |
48 | | - display:block; |
49 | | - } |
50 | | - .example-show-hide.ng-hide { |
51 | | - display:none; |
| 48 | + display:block!important; |
52 | 49 | } |
53 | 50 |
|
54 | | - .example-show-hide.ng-hide-remove { |
55 | | - display:block; |
| 51 | + .animate-show.ng-hide-add.ng-hide-add-active, |
| 52 | + .animate-show.ng-hide-remove { |
56 | 53 | line-height:0; |
57 | 54 | opacity:0; |
58 | 55 | padding:0 10px; |
59 | 56 | } |
60 | | - .example-show-hide.ng-hide-remove.ng-hide-remove-active { |
61 | | - line-height:20px; |
62 | | - opacity:1; |
63 | | - padding:10px; |
64 | | - border:1px solid black; |
65 | | - background:white; |
66 | | - } |
67 | 57 |
|
68 | | - .example-show-hide.ng-hide-add { |
| 58 | + .animate-show.ng-hide-add, |
| 59 | + .animate-show.ng-hide-remove.ng-hide-remove-active { |
69 | 60 | line-height:20px; |
70 | 61 | opacity:1; |
71 | 62 | padding:10px; |
72 | 63 | border:1px solid black; |
73 | 64 | background:white; |
74 | 65 | } |
75 | | - .example-show-hide.ng-hide-add.ng-hide-add-active { |
76 | | - line-height:0; |
77 | | - opacity:0; |
78 | | - padding:0 10px; |
79 | | - } |
80 | 66 |
|
81 | 67 | .check-element { |
82 | 68 | padding:10px; |
@@ -132,55 +118,42 @@ var ngShowDirective = ['$animate', function($animate) { |
132 | 118 | Click me: <input type="checkbox" ng-model="checked"><br/> |
133 | 119 | <div> |
134 | 120 | Show: |
135 | | - <span class="check-element example-show-hide" ng-show="checked"> |
| 121 | + <div class="check-element animate-hide" ng-show="checked"> |
136 | 122 | <span class="icon-thumbs-up"></span> I show up when your checkbox is checked. |
137 | | - </span> |
| 123 | + </div> |
138 | 124 | </div> |
139 | 125 | <div> |
140 | 126 | Hide: |
141 | | - <span class="check-element example-show-hide" ng-hide="checked"> |
| 127 | + <div class="check-element animate-hide" ng-hide="checked"> |
142 | 128 | <span class="icon-thumbs-down"></span> I hide when your checkbox is checked. |
143 | | - </span> |
| 129 | + </div> |
144 | 130 | </div> |
145 | 131 | </file> |
146 | 132 | <file name="animations.css"> |
147 | | - .example-show-hide { |
| 133 | + .animate-hide.ng-hide-add, |
| 134 | + .animate-hide.ng-hide-remove { |
148 | 135 | -webkit-transition:all linear 0.5s; |
149 | 136 | -moz-transition:all linear 0.5s; |
150 | 137 | -o-transition:all linear 0.5s; |
151 | 138 | transition:all linear 0.5s; |
152 | | - display:block; |
153 | | - } |
154 | | - .example-show-hide.ng-hide { |
155 | | - display:none; |
| 139 | + display:block!important; |
156 | 140 | } |
157 | 141 |
|
158 | | - .example-show-hide.ng-hide-remove { |
159 | | - display:block; |
| 142 | + .animate-hide.ng-hide-add.ng-hide-add-active, |
| 143 | + .animate-hide.ng-hide-remove { |
160 | 144 | line-height:0; |
161 | 145 | opacity:0; |
162 | 146 | padding:0 10px; |
163 | 147 | } |
164 | | - .example-show-hide.ng-hide-remove.ng-hide-remove-active { |
165 | | - line-height:20px; |
166 | | - opacity:1; |
167 | | - padding:10px; |
168 | | - border:1px solid black; |
169 | | - background:white; |
170 | | - } |
171 | 148 |
|
172 | | - .example-show-hide.ng-hide-add { |
| 149 | + .animate-hide.ng-hide-add, |
| 150 | + .animate-hide.ng-hide-remove.ng-hide-remove-active { |
173 | 151 | line-height:20px; |
174 | 152 | opacity:1; |
175 | 153 | padding:10px; |
176 | 154 | border:1px solid black; |
177 | 155 | background:white; |
178 | 156 | } |
179 | | - .example-show-hide.ng-hide-add.ng-hide-add-active { |
180 | | - line-height:0; |
181 | | - opacity:0; |
182 | | - padding:0 10px; |
183 | | - } |
184 | 157 |
|
185 | 158 | .check-element { |
186 | 159 | padding:10px; |
|
0 commit comments