{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% block javascript %}
<script>
$(function () {
var slidesToshow_val = 3;
var slidesToshow_leng = $('.card-pickup').length;
if(slidesToshow_leng < slidesToshow_val){
slidesToshow_val = slidesToshow_leng;
}
$('.slider-pickup').slick({
arrows: true,
slidesToShow: slidesToshow_val,
centerMode: true,
responsive: [
{
breakpoint: 768,
settings: {
arrows: true,
centerMode: true,
centerPadding: '40px',
slidesToShow: 1
}
}
],
});
});
</script>
{#<script>#}
{# $(function () {#}
{# $('.slider-pickup').slick({#}
{# arrows: true,#}
{# slidesToShow: 3,#}
{# centerMode: true,#}
{# responsive: [#}
{# {#}
{# breakpoint: 768,#}
{# settings: {#}
{# arrows: true,#}
{# centerMode: true,#}
{# centerPadding: '40px',#}
{# slidesToShow: 1#}
{# },#}
{# },#}
{# ],#}
{# });#}
{# });#}
{#</script>#}
<script>
window.addEventListener('load', function () {
var maxHeight = 0;
$('.slider-pickup .slider_item').each(function (idx, elem) {
var height = $(elem).height();
if (maxHeight < height) {
maxHeight = height;
}
});
$('.slider-pickup .slider_item').height(maxHeight);
});
</script>
{% endblock javascript %}
{% set ProductList = PickupProductList %}
{% if ProductList|length > 0 %}
<section class="pickup bg-gray">
<div class="container">
<h2 class="section-title">
<span class="_sub">
PICK UP
</span>
<span class="_main">
オススメ書籍
</span>
</h2>
<div class="pickup__content">
<div class="slider-pickup">
{% for Product in ProductList %}
<a class="slider_item card-pickup" href="{{ url('product_detail', {'id': Product.id}) }}">
<div class="card-pickup__content">
{# 新刊ラベル #}
{% if Product.new_book_flag %}
<div class="card-pickup__new">
<img src="{{ asset('assets/img/top/pickup_new.png','user_data') }}" alt="">
</div>
{% endif %}
{# 画像 #}
<div class="card-pickup__img">
<img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}">
</div>
<p class="card-pickup__title">{{ Product.name }}</p>
<p class="card-pickup__text">
{{ Product.description_detail|length > 50 ? Product.description_detail|slice(0, 50) ~ '…' : Product.description_detail }}
</p>
</div>
<p class="card-pickup__btn">
詳しく見る
</p>
</a>
{% endfor %}
</div>
</div>
</div>
</section>
{% endif %}