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.animateFadeIn = function(options){ 14 // DOM夿°ã¨ãã¦åå®ç¾© 15 var $this = this; 16 17 // ãªãã·ã§ã³ã¨ããã©ã«ãå¤ãè¨å®ãã 18 var defaults = { 19 movement : 40, //ç§»åéï¼pxï¼ 20 duration : 500, //ã¢ãã¡ã¼ã·ã§ã³æé 21 direction : 'none', //ã¢ãã¡ã¼ã·ã§ã³æ¹åï¼Lï¼å·¦ã¸ãTï¼ä¸ã¸ãRï¼å³ã¸ãBï¼ä¸ã¸ãnoneï¼ç§»åãããªãï¼ 22 23 }; 24 // ãªãã·ã§ã³ã夿°ã¸æ ¼ç´ 25 var setting = $.extend(defaults, options); 26 // ã¡ã¤ã³å¦çã®é¢æ° 27 var doAnimate = function($target, movement, durationTime, direction){ 28 // è¤æ°DOM対å¿ã®ããã®ã«ã¼ãå¦ç 29 for(var i = 0; i < $target.length; i++){ 30 var delay = 0; 31 delay = $target.eq(i).data('delay'); 32 // DOMã®åº§æ¨åå¾ 33 var posY = $target.eq(i).offset().top; 34 // ã¹ã¯ãã¼ã«éï¼ã¦ã£ã³ãã¦ã®é«ãåã®åº§æ¨ãDOM座æ¨ãä¸åãå ´å 35 if(posY <= (scrollY + $(window).height())){ 36 // ã¢ãã¡ã¼ã·ã§ã³æ¹åå¥ã«ã¢ãã¡ã¼ã·ã§ã³ 37 if(direction === 'T'){ 38 $target.eq(i).delay(delay).velocity({ 39 opacity: 1, 40 translateY: '-'+movement+'px', 41 },{ 42 duration: durationTime, 43 }); 44 }else if(direction === 'R'){ 45 $target.eq(i).delay(delay).velocity({ 46 opacity: 1, 47 translateX: movement+'px', 48 },{ 49 duration: durationTime, 50 }); 51 }else if(direction === 'L'){ 52 $target.eq(i).delay(delay).velocity({ 53 opacity: 1, 54 translateX: '-'+movement+'px', 55 },{ 56 duration: durationTime, 57 }); 58 }else if(direction === 'B'){ 59 $target.eq(i).delay(delay).velocity({ 60 opacity: 1, 61 translateY: movement+'px', 62 },{ 63 duration: durationTime, 64 }); 65 }else if(direction === 'none'){ 66 $target.eq(i).delay(delay).velocity({ 67 opacity: 1, 68 },{ 69 duration: durationTime, 70 }); 71 } 72 } 73 } 74 }; 75 76 //åæå¦ç颿° 77 var init = function(){ 78 $this.css('opacity',0); 79 //ã¢ãã¡ã¼ã·ã§ã³æ¹åå¥ã«DOMã®ã¹ã¿ã¤ã«ãèª¿æ´ 80 if(setting.direction === 'T'){ 81 $this.css({'position':'relative', 'top': setting.movement+'px', 'opacity':'0'}); 82 }else if(setting.direction === 'R'){
83 $this.css({'position':'relative', 'left': '-'+setting.movement+'px', 'opacity':'0'}); 84 }else if(setting.direction === 'L'){ 85 $this.css({'position':'relative', 'left': setting.movement+'px', 'opacity':'0'}); 86 }else if(setting.direction === 'B'){ 87 $this.css({'position':'relative', 'top': '-'+setting.movement+'px', 'opacity':'0'}); 88 }else if(setting.direction === 'none'){ 89 $this.css({'opacity':'0'}); 90 } 91 }; 92 93 init(); 94 95 $(window).on('scroll', function(){ 96 doAnimate($this, setting.movement, setting.duration, setting.direction); 97 }); 98 99 //ã¡ã½ãããã§ã¼ã³å¯¾å¿(thisãè¿ã) 100 return(this); 101 }; 102})(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.