index.blade.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. @extends('module.layouts.content')
  2. @push('meta')
  3. @endpush
  4. @push('css')
  5. <link href="{{ theme_asset('app/css/common.css') }}" rel="stylesheet">
  6. <link rel="stylesheet" type="text/css" href="{{ theme_asset('app/css/hrtools/hrtools.css') }}"/>
  7. @endpush
  8. @push('js')
  9. @endpush
  10. @section('content')
  11. <div class="new-hr-tp"></div>
  12. <div class="new-hr-main">
  13. @if($hrtools_categories->toArray())
  14. @foreach($hrtools_categories as $k=>$cate)
  15. <div class="nhm-cell">
  16. <div class="hc-top-bar"></div>
  17. <div class="hc-ic-bar">
  18. <div class="hc-sp-h20"></div>
  19. <div class="hib-icon h1">
  20. <img src="{{$cate->category_img}}">
  21. </div>
  22. <div class="hc-sp-h14"></div>
  23. <div class="hc-sp-l">{{$cate->category_name}}</div>
  24. </div>
  25. <div class="hc-tx-bar">{{$cate->content}}</div>
  26. <div class="hc-m-l"><a target="_blank" rel="nofollow noopener noreferrer" href="{{route('hrtools.list',['id'=>$cate->id])}}" class="hc-more">查看更多</a></div>
  27. </div>
  28. @endforeach
  29. @endif
  30. <div class="clear"></div>
  31. </div>
  32. {{-- 页脚 --}}
  33. @endsection
  34. @section('script')
  35. <script>
  36. // 处理最后几个下边距的问题
  37. var num = $('.nhm-cell').length;
  38. if (num%3 == 0) {
  39. $('.nhm-cell').eq(num-1).css('margin-bottom', '0');
  40. $('.nhm-cell').eq(num-2).css('margin-bottom', '0');
  41. $('.nhm-cell').eq(num-3).css('margin-bottom', '0');
  42. }
  43. if (num%3 == 1) {
  44. $('.nhm-cell').eq(num-1).css('margin-bottom', '0');
  45. }
  46. if (num%3 == 2) {
  47. $('.nhm-cell').eq(num-1).css('margin-bottom', '0');
  48. $('.nhm-cell').eq(num-2).css('margin-bottom', '0');
  49. }
  50. </script>
  51. @endsection