parallax.js
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var options = typeof option == 'object' && option;

      if (this == window || this == document || $this.is('body')) {
        Parallax.configure(options);
      }
      else if (!$this.data('px.parallax')) {
        options = $.extend({}, $this.data(), options);
        $this.data('px.parallax', new Parallax(this, options));
      }
      else if (typeof option == 'object')
      {
        $.extend($this.data('px.parallax'), options);
      }
      if (typeof option == 'string') {
        if(option == 'destroy'){
            Parallax.destroy(this);
        }else{
          Parallax[option]();
        }
      }
    });
  }
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var options = typeof option == 'object' && option;

      if (this == window || this == document || $this.is('body')) {
        Parallax.configure(options);
      }
      else if (!$this.data('px.parallax')) {
        options = $.extend({}, $this.data(), options);
        $this.data('px.parallax', new Parallax(this, options));
      }
      else if (typeof option == 'object')
      {
        $.extend($this.data('px.parallax'), options);
      }
      if (typeof option == 'string') {
        if(option == 'destroy'){
            Parallax.destroy(this);
        }else{
          Parallax[option]();
        }
      }
    });
  }
function Plugin ( option ) { return this . each ( function ( ) { var $this = $ ( this ) ; var options = typeof option == 'object' && option ; if ( this == window || this == document || $this . is ( 'body' ) ) { Parallax . configure ( options ) ; } else if ( ! $this . data ( 'px.parallax' ) ) { options = $ . extend ( { } , $this . data ( ) , options ) ; $this . data ( 'px.parallax' , new Parallax ( this , options ) ) ; } else if ( typeof option == 'object' ) { $ . extend ( $this . data ( 'px.parallax' ) , options ) ; } if ( typeof option == 'string' ) { if ( option == 'destroy' ) { Parallax . destroy ( this ) ; } else { Parallax [ option ] ( ) ; } } } ) ; }
Parallax Plugin Definition
Parallax Plugin Definition