PageSourceSearch

https://webukatu.com/assets/js/plugins/palalaxAnimatePlugin.js?1575572580

js webukatu.com collected 2026-10-02 06:17:04 UTC 1,835 bytes, 69 lines download raw bytes

1/*
2 Version: 1.0
3  Author: Kazuki Saito
4 Website: http://webukatu.com
5 Website: http://crazy-wp.com
6    Docs: 
7    Repo: 
8  Issues: 
9 License: MIT
10 */
11(function($) {
12  // プラグイン定義
13  $.fn.animatePalalax = function(options){
14    // DOM変数として再定義
15    var $this = this;
16
17    // オプションとデフォルト値を設定する
18    var defaults = {
19      movement : 5, //移動量
20      direction : 'B', //移動方向(L:左へ、T:上へ、R:右へ、B:下へ)
21    };
22    
23    // DOM座標取得
24    var top = $this.offset();
25    
26    // オプションを変数へ格納
27    var setting = $.extend(defaults, options);
28    
29    // DOM座標格納用配列
30    var targetsY = [];
31    
32    // メイン処理の関数
33    var doAnimate = function($target, movement, direction){
34      
35      // scroll量を取得
36      var scrollY = $(window).scrollTop();
37      
38      // 複数DOM対応のためのループ処理
39      for(var i = 0; i < $target.length; i++){
40        if(direction === 'B'){
41          $target.eq(i).css('top',targetsY[i] + scrollY / movement);
42        }else if(direction === 'R'){
43          $target.eq(i).css('left',targetsY[i] + scrollY / movement);
44        }else if(direction === 'L'){
45          $target.eq(i).css('right',targetsY[i] + scrollY / movement);
46        }else if(direction === 'T'){
47          $target.eq(i).css('top', -(targetsY[i] + scrollY / movement));
48        }
49        
50      }
51    };
52    
53    var init = function(){
54      // DOM座標取得
55      for(var i = 0; i < $this.length; i++){
56        targetsY[i] = $this.eq(i).offset().top;
57      }
58    };
59    
60    init();
61
62    $(window).on('scroll', function(){
63      doAnimate($this, setting.movement, setting.direction);
64    });
65
66    //メソッドチェーン対応(thisを返す)
67    return(this);
68  };
69})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.