|
30 | 30 | overlayParentElement : 'body'
|
31 | 31 | }, options);
|
32 | 32 |
|
| 33 | + methods.settings = { |
| 34 | + events: { |
| 35 | + inStartLegacy: 'animsition.start', // Removed in v4.0 |
| 36 | + inEndLegacy: 'animsition.end', // Removed in v4.0 |
| 37 | + inStart: 'animsition.inStart', |
| 38 | + inEnd: 'animsition.inEnd', |
| 39 | + outStart: 'animsition.outStart', |
| 40 | + outEnd: 'animsition.outEnd' |
| 41 | + } |
| 42 | + }; |
| 43 | + |
33 | 44 | // Remove the "Animsition" in a browser
|
34 | 45 | // that does not support the "animaition-duration".
|
35 | 46 | var support = methods.supportCheck.call(this, options);
|
|
188 | 199 | var $this = $(this);
|
189 | 200 |
|
190 | 201 | $this
|
191 |
| - .trigger('animsition.start') |
192 | 202 | .css({ 'animation-duration' : (inDuration / 1000) + 's' })
|
193 | 203 | .addClass(inClass)
|
| 204 | + .trigger(methods.settings.events.inStartLegacy) // Removed in v4.0 |
| 205 | + .trigger(methods.settings.events.inStart) |
194 | 206 | .animateCallback(function(){
|
195 | 207 | $this
|
196 | 208 | .removeClass(inClass)
|
197 | 209 | .css({ 'opacity' : 1 })
|
198 |
| - .trigger('animsition.end'); |
| 210 | + .trigger(methods.settings.events.inEndLegacy) // Removed in v4.0 |
| 211 | + .trigger(methods.settings.events.inEnd); |
199 | 212 | });
|
200 | 213 | },
|
201 | 214 |
|
|
204 | 217 | var options = $this.data(namespace).options;
|
205 | 218 |
|
206 | 219 | $this
|
207 |
| - .trigger('animsition.start') |
208 |
| - .css({ 'opacity' : 1 }); |
| 220 | + .css({ 'opacity' : 1 }) |
| 221 | + .trigger(methods.settings.events.inStartLegacy) // Removed in v4.0 |
| 222 | + .trigger(methods.settings.events.inStart); |
209 | 223 |
|
210 | 224 | $(options.overlayParentElement)
|
211 | 225 | .children('.' + options.overlayClass)
|
212 | 226 | .css({ 'animation-duration' : (inDuration / 1000) + 's' })
|
213 | 227 | .addClass(inClass)
|
214 | 228 | .animateCallback(function(){
|
215 |
| - $this.trigger('animsition.end'); |
| 229 | + $this |
| 230 | + .trigger(methods.settings.events.inEndLegacy) // Removed in v4.0 |
| 231 | + .trigger(methods.settings.events.inEnd); |
216 | 232 | });
|
217 | 233 | },
|
218 | 234 |
|
|
244 | 260 | $this
|
245 | 261 | .css({ 'animation-duration' : ((outDuration + 1) / 1000) + 's' })
|
246 | 262 | .addClass(outClass)
|
| 263 | + .trigger(methods.settings.events.outStart) |
247 | 264 | .animateCallback(function(){
|
248 |
| - location.href = url; |
| 265 | + $this.trigger(methods.settings.events.outEnd); |
| 266 | + window.location.href = url; |
249 | 267 | });
|
250 | 268 | },
|
251 | 269 |
|
| 270 | + |
252 | 271 | pageOutOverlay: function(outClass,outDuration,url){
|
253 | 272 | var _this = this;
|
254 | 273 | var $this = $(this);
|
|
262 | 281 | .css({ 'animation-duration' : ((outDuration + 1) / 1000) + 's' })
|
263 | 282 | .removeClass(inClass)
|
264 | 283 | .addClass(outClass)
|
| 284 | + .trigger(methods.settings.events.outStart) |
265 | 285 | .animateCallback(function(){
|
266 |
| - location.href = url; |
| 286 | + $this.trigger(methods.settings.events.outEnd); |
| 287 | + window.location.href = url; |
267 | 288 | });
|
268 | 289 | },
|
269 | 290 |
|
|
0 commit comments