File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 333
333
self . isBusy = false ;
334
334
} ) ;
335
335
}
336
+ } ,
337
+ destroy : function ( el ) {
338
+ var i ,
339
+ parallaxElement = $ ( el ) . data ( 'px.parallax' ) ;
340
+ parallaxElement . $mirror . remove ( ) ;
341
+ for ( i = 0 ; i < this . sliders . length ; i += 1 ) {
342
+ if ( this . sliders [ i ] == parallaxElement ) {
343
+ this . sliders . splice ( i , 1 ) ;
344
+ }
345
+ }
346
+ $ ( el ) . data ( 'px.parallax' , false ) ;
347
+ if ( this . sliders . length === 0 ) {
348
+ $ ( window ) . off ( 'scroll.px.parallax resize.px.parallax load.px.parallax' ) ;
349
+ this . isReady = false ;
350
+ Parallax . isSetup = false ;
351
+ }
336
352
}
337
353
} ) ;
338
354
356
372
$ . extend ( $this . data ( 'px.parallax' ) , options ) ;
357
373
}
358
374
if ( typeof option == 'string' ) {
359
- Parallax [ option ] ( ) ;
375
+ if ( option == 'destroy' ) {
376
+ Parallax [ 'destroy' ] ( this ) ;
377
+ } else {
378
+ Parallax [ option ] ( ) ;
379
+ }
360
380
}
361
381
} )
362
382
} ;
You can’t perform that action at this time.
0 commit comments