_ui.carousel.scss 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. @charset "utf-8";
  2. /*
  3. * @file: 旋转木马基础UI组件
  4. * @update: 2015-06-03 16:33:54
  5. */
  6. /*
  7. * 默认旋转木马
  8. * @base
  9. */
  10. $carousel-x-width: 440px; // 主体宽度
  11. $carousel-x-per-number: 5; // 每一页item个数
  12. $carousel-x-item-height: 80px; // item高度
  13. $carousel-x-item-width: 80px; // item宽度
  14. $carousel-x-spacing: 10px; // item间距
  15. $carousel-x-switch-btn-width: 24px; // 翻页按钮宽度
  16. .ui-carousel {
  17. position: relative;
  18. width: $carousel-x-per-number*$carousel-x-item-width+($carousel-x-per-number - 1)*$carousel-x-spacing;
  19. padding: 0 $carousel-x-switch-btn-width+$carousel-x-spacing;
  20. }
  21. .ui-carousel__scroller {
  22. width: $carousel-x-per-number*$carousel-x-item-width+($carousel-x-per-number - 1)*$carousel-x-spacing;
  23. height: $carousel-x-item-height;
  24. overflow: hidden;
  25. }
  26. .ui-carousel__content {
  27. width: 100000px !important; /* 修正carousel组件自生成的长度值太大导致低版本IE不显示的bug */
  28. height: $carousel-x-item-height;
  29. }
  30. .ui-carousel__item {
  31. float: left;
  32. width: $carousel-x-item-width;
  33. height: $carousel-x-item-height;
  34. margin-right: $carousel-x-spacing;
  35. }
  36. .ui-carousel__prev,
  37. .ui-carousel__next {
  38. position: absolute;
  39. top: 0;
  40. width: $carousel-x-switch-btn-width;
  41. height: $carousel-x-item-height;
  42. line-height: $carousel-x-item-height;
  43. cursor: pointer;
  44. text-align: center;
  45. &.is-disabled {
  46. color: #ccc;
  47. cursor: default;
  48. }
  49. .ui-icon {
  50. font-size: 24px;
  51. }
  52. }
  53. .ui-carousel__prev {
  54. left: 0;
  55. }
  56. .ui-carousel__next {
  57. right: 0;
  58. }
  59. .ui-carousel__controller {
  60. margin-top: 5px;
  61. text-align: center;
  62. .ui-carousel__prev {
  63. margin-right: 5px;
  64. }
  65. }
  66. /*
  67. * 纵向旋转木马
  68. * @extend: vertical
  69. */
  70. $carousel-y-width: 300px; // 主体宽度
  71. $carousel-y-per-number: 5; // 每一页item个数
  72. $carousel-y-item-width: 300px; // item宽度
  73. $carousel-y-item-height: 50px; // item高度
  74. $carousel-y-spacing: 10px; // item间距
  75. $carousel-y-switch-btn-height: 24px; // 翻页按钮高度
  76. .ui-carousel {
  77. &.ext-vertical {
  78. width: $carousel-y-width;
  79. padding: 29px 0;
  80. .ui-carousel__content {
  81. width: auto !important;
  82. height: auto;
  83. }
  84. .ui-carousel__scroller {
  85. width: $carousel-y-width;
  86. height: $carousel-y-per-number*$carousel-y-item-height+($carousel-y-per-number - 1)*$carousel-y-spacing;
  87. overflow: hidden;
  88. }
  89. .ui-carousel__item {
  90. float: none;
  91. width: auto;
  92. height: $carousel-y-item-height;
  93. padding: $carousel-y-spacing/2 0;
  94. margin: 0;
  95. }
  96. .ui-carousel__prev,
  97. .ui-carousel__next {
  98. width: $carousel-y-width;
  99. height: $carousel-y-switch-btn-height;
  100. line-height: $carousel-y-switch-btn-height;
  101. }
  102. .ui-carousel__prev {
  103. top: 0;
  104. left: 0;
  105. }
  106. .ui-carousel__next {
  107. top: auto;
  108. right: 0;
  109. bottom: 0;
  110. }
  111. }
  112. }