|
185 | 185 | </div>
|
186 | 186 | @endsection
|
187 | 187 |
|
188 |
| -@section('script') |
| 188 | +@section('javascript') |
189 | 189 | {!! HTML::script('//cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.5.9/jquery.fullPage.min.js') !!}
|
190 | 190 | {!! HTML::script('//cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.5.9/vendors/jquery.easings.min.js') !!}
|
191 | 191 | {!! HTML::script('//cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.5.9/vendors/jquery.slimscroll.min.js') !!}
|
192 | 192 | {!! HTML::script('https://apis.google.com/js/platform.js') !!}
|
193 |
| -@endsection |
194 | 193 |
|
195 |
| -@section('javascript') |
196 |
| - $(document).ready(function() { |
197 |
| - $('#fullpage').fullpage({ |
198 |
| - {{-- Extra small devices (xs) is < 768px --}} |
199 |
| - paddingTop: ($( window ).width() >= 768) ? '50px' : '0px', |
200 |
| - scrollOverflow: ($( window ).width() >= 768), |
201 |
| - scrollBar: true, |
202 |
| - responsive: 768, |
203 |
| - {{-- sectionsColor: ['black', '#4BBFC3', '#7BAABE', '#ccddff'], --}} |
204 |
| - anchors: ['welcome', 'about', 'class', 'activity'] |
| 194 | + <script type="text/javascript"> |
| 195 | + $(document).ready(function () { |
| 196 | + $('#fullpage').fullpage({ |
| 197 | + {{-- Extra small devices (xs) is < 768px --}} |
| 198 | + paddingTop: ($(window).width() >= 768) ? '50px' : '0px', |
| 199 | + scrollOverflow: ($(window).width() >= 768), |
| 200 | + scrollBar: true, |
| 201 | + responsive: 768, |
| 202 | + {{-- sectionsColor: ['black', '#4BBFC3', '#7BAABE', '#ccddff'], --}} |
| 203 | + anchors: ['welcome', 'about', 'class', 'activity'] |
| 204 | + }); |
205 | 205 | });
|
206 |
| - }); |
207 |
| - $(document).ready(function () { |
208 |
| - {{-- //TODO:: 隱藏顯示不下的課程,暫時從前台下手, |
209 |
| - 未來應該改成從後台下手,固定顯示數量, |
210 |
| - 前台在動態固定表格高度,可能在加一層div |
211 |
| - 這樣在空間不足時,還有個卷軸可用 |
212 |
| - 雖然應該會很難操作。--}} |
213 |
| - {{-- 限制課程清單只有 section3 高度的 50% --}} |
214 |
| - var targetTableHeight = ($( window ).width() >= 768) ? $( window ).height() * 0.5 : $( window ).height() * 1.5; |
215 |
| - if ($('#classList').height() > targetTableHeight) { |
216 |
| - var trList = $('#classList tbody tr'); |
217 |
| - for (var i = 0; i < trList.length; i++) { |
218 |
| - {{-- jQuery 怪怪的,不能用 hasClass ... --}} |
219 |
| - {{-- //TODO:: 未來可能會有 Bug --}} |
220 |
| - if (trList[i].className.indexOf('success') != -1) { |
221 |
| - trList[i].style.display = 'none'; |
222 |
| - if ($('#classList').height() <= targetTableHeight) break; |
| 206 | + $(document).ready(function () { |
| 207 | + {{-- //TODO:: 隱藏顯示不下的課程,暫時從前台下手, |
| 208 | + 未來應該改成從後台下手,固定顯示數量, |
| 209 | + 前台在動態固定表格高度,可能在加一層div |
| 210 | + 這樣在空間不足時,還有個卷軸可用 |
| 211 | + 雖然應該會很難操作。--}} |
| 212 | + {{-- 限制課程清單只有 section3 高度的 50% --}} |
| 213 | + var targetTableHeight = ($(window).width() >= 768) ? $(window).height() * 0.5 : $(window).height() * 1.5; |
| 214 | + if ($('#classList').height() > targetTableHeight) { |
| 215 | + var trList = $('#classList tbody tr'); |
| 216 | + for (var i = 0; i < trList.length; i++) { |
| 217 | + {{-- jQuery 怪怪的,不能用 hasClass ... --}} |
| 218 | + {{-- //TODO:: 未來可能會有 Bug --}} |
| 219 | + if (trList[i].className.indexOf('success') != -1) { |
| 220 | + trList[i].style.display = 'none'; |
| 221 | + if ($('#classList').height() <= targetTableHeight) break; |
| 222 | + } |
223 | 223 | }
|
224 | 224 | }
|
225 |
| - } |
226 | 225 |
|
227 |
| - if ($('#classList').height() > targetTableHeight) { |
228 |
| - var trList = $('#classList tbody tr'); |
229 |
| - var hasNone = false; |
230 |
| - for (var i = trList.length - 1; i >= 0 ; i--) { |
231 |
| - if (trList[i].className.indexOf('info') != -1) { |
232 |
| - trList[i].style.display = 'none'; |
233 |
| - if ($('#classList').height() <= targetTableHeight) break; |
| 226 | + if ($('#classList').height() > targetTableHeight) { |
| 227 | + var trList = $('#classList tbody tr'); |
| 228 | + var hasNone = false; |
| 229 | + for (var i = trList.length - 1; i >= 0; i--) { |
| 230 | + if (trList[i].className.indexOf('info') != -1) { |
| 231 | + trList[i].style.display = 'none'; |
| 232 | + if ($('#classList').height() <= targetTableHeight) break; |
| 233 | + } |
234 | 234 | }
|
235 | 235 | }
|
236 |
| - } |
237 |
| - }); |
| 236 | + }); |
| 237 | + </script> |
238 | 238 | @endsection
|
0 commit comments