app/template/default/Block/Sp/Item/lm_item_recently_checked_item.twig line 1

Open in your IDE?
  1. <style>
  2.     #recentviews img {
  3.         height: auto;
  4.         max-width: none;
  5.         padding: 0;
  6.         display: inline-block;
  7.         border: 1px solid rgb(204, 204, 204);
  8.     }
  9. </style>
  10. <div style="width: 100vw;">
  11.     <div class="title-h2">
  12.         <h2>&nbsp;最近閲覧した商品はこちら</h2>
  13.     </div>
  14.     <div class="recentviews ajax" style="margin-top:10px;">
  15.         <div id="recentviews" style="overflow: hidden; margin: 0;">
  16.             <div style="margin-left: 0;display:flex;overflow-x:scroll;-webkit-overflow-scrolling: touch;">
  17.                 {% for item in recentviews %}
  18.                     <div style="width: 105px; float: left;margin: 0 6px;margin-bottom: 15px;">
  19.                         <div>
  20.                             <a href="/item/{{ item.item_id }}.html">
  21.                                 <img class="recommend-images" src="{{ makeImageURL("goods.img", item.id) }}" border="0" name="" alt="{{ item.goods_name }}">
  22.                             </a>
  23.                         </div>
  24.                         <div style="margin-top: 5px; font-size: 11px;line-height:1.3em;">
  25.                             <a href="/item/{{ item.item_id }}.html">{{ item.goods_name }}</a>
  26.                         </div>
  27.                         <div style="font-size: 11px; color: #666;">
  28.                             <span class="recent_item_price">
  29.                                 {{ php_number_format(item.min_gp_price_inc_tax) }}円(税込)</span>
  30.                             ~
  31.                             {% if item.review is defined and item.review > 0 %}
  32.                                 <div class="recommend-average">{{ item.average_img | raw }}<span class="recommend-average-bracket">(</span>
  33.                                     <span class="recommend-average-point">{{ php_number_format(item.review) }}</span>
  34.                                     <span class="recommend-average-bracket">)</span>
  35.                                 </div>
  36.                             {% endif %}
  37.                         </div>
  38.                     </div>
  39.                 {% endfor %}
  40.             </div>
  41.         </div>
  42.     </div>
  43. </div>
  44. <script async>
  45.     $(function () {
  46.     $(".recommend-images").on("load", function (e) {
  47.       if (this.width > 105) {
  48.         $(this).css("height", "auto");
  49.         $(this).css("width", "105px");
  50.       }
  51.     $(this).css({
  52.       "padding-top": (150 - this.height) / 2,
  53.       "padding-right": (105 - this.width) / 2,
  54.       "padding-bottom": (150 - this.height) / 2,
  55.       "padding-left": (105 - this.width) / 2
  56.     });
  57.     }).each(function () {
  58.       if (this.complete || /*for IE 10-*/
  59.         $(this).height() > 0)
  60.         $(this).load();
  61.       });
  62.   });
  63. </script>