Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js |
— | — | @@ -34,8 +34,9 @@ |
35 | 35 | var ele = this; |
36 | 36 | var $me = jQuery( this ); |
37 | 37 | var $sp; |
38 | | - var fnEnd,fnScroll; |
39 | | - var offset= 0 ; |
| 38 | + var fnEnd; |
| 39 | + var fnScroll; |
| 40 | + var offset = 0; |
40 | 41 | var lsp = -1; |
41 | 42 | |
42 | 43 | _css(); |
— | — | @@ -69,26 +70,26 @@ |
70 | 71 | os=$me.find('.batch:first').next().offset().top; |
71 | 72 | b=($me.height()/os+1)*os; |
72 | 73 | |
73 | | - if("auto"==opt.uBound){ |
74 | | - opt.uBound=b; |
| 74 | + if ( "auto" == opt.uBound ) { |
| 75 | + opt.uBound = b; |
75 | 76 | } |
76 | 77 | |
77 | | - if("auto"==opt.lBound){ |
78 | | - opt.lBound=-b; |
| 78 | + if ( "auto" == opt.lBound ) { |
| 79 | + opt.lBound = -b; |
79 | 80 | } |
80 | 81 | |
81 | | - if("auto"==opt.eBound){ |
82 | | - opt.eBound=b*2; |
| 82 | + if ( "auto" == opt.eBound ) { |
| 83 | + opt.eBound = b * 2; |
83 | 84 | } |
84 | 85 | } |
85 | 86 | |
86 | | - function batch($s, offset ,opt){ |
| 87 | + function batch( $s, offset, opt ) { |
87 | 88 | var $b; |
88 | 89 | var i; |
89 | 90 | var rp = opt.batchNum; |
90 | 91 | |
91 | 92 | while( rp-- ) { |
92 | | - $b=jQuery(opt.batchTemplate) |
| 93 | + $b=jQuery( opt.batchTemplate ) |
93 | 94 | .attr({ |
94 | 95 | offset:offset, |
95 | 96 | len:opt.batchSiz |
— | — | @@ -107,18 +108,18 @@ |
108 | 109 | return offset; |
109 | 110 | }; |
110 | 111 | |
111 | | - function vScroll(){ |
| 112 | + function vScroll() { |
112 | 113 | var so = $me.scrollTop(); |
113 | 114 | |
114 | 115 | if( lsp != so){ |
115 | 116 | lsp = so; |
116 | 117 | var co = $me.offset().top; |
117 | 118 | |
118 | | - $sp.find( '> .' + opt.emptyBatchClass ).each(function( i, obj ){ |
119 | | - var $b=jQuery(obj); |
120 | | - var p=$b.position().top-co; |
121 | | - if(opt.lBound>p||p>opt.uBound){return;} |
122 | | - opt.updateBatch($b.removeClass(opt.emptyBatchClass)); |
| 119 | + $sp.find( '> .' + opt.emptyBatchClass ).each( function( i, obj ) { |
| 120 | + var $b = jQuery( obj ); |
| 121 | + var p = $b.position().top - co; |
| 122 | + if ( opt.lBound > p || p > opt.uBound ) { return; } |
| 123 | + opt.updateBatch( $b.removeClass( opt.emptyBatchClass ) ); |
123 | 124 | }); |
124 | 125 | } |
125 | 126 | }; |