Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Переключение блоков фото в другую сторону в блоке


bodyak0
 Share

Recommended Posts

Всем привет, нужно мне вывести 2 блока чтобы картинки слагдера чередовались.
Не знаю как на Js это реализовать чтобы каждый блок был со своим классом к примеру вот ситикой если выводить но нормально все:
Помогите сгделать nth-child как то))Спасипотому что! С меня пивасик

<div class="featuted-product-wrap section-space--pt_120">
            <div class="container">
                <div class="row align-items-center featuted-product-one">
                    <div class="col-lg-6 col-md-6 order-md-1 order-1">
                        <div class="product-thumbnail">
                            <a href="shop-left-sidebar.html"><img src="images/df-1.png" class="img-fluid" alt="Featured Image"></a>
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 order-md-2 order-2">
                        <div class="featured-product-contect">
                            <h6 class="sub-heading mb-2">FEATURED PRODUCT</h6>
                            <h2 class="section-title--one"><a href="shop-left-sidebar.html">Категория Chair</a></h2>
                            <p class="mt-30">When an unknown printer took a galley of type and scrambled it to make a
                                type specimen book. Excepteur sint occaecat cupidatat non proident, sunt in
                                culpa qui officia.</p>
                            <div class="button-box section-space--mt_60">
                                <a href="shop-4-column.html" class="btn btn--md btn--border_1">Only $90 <i class="icon-arrow-right"></i></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="images-text-bg text-right">
                <img src="images/bg-df-1-300x49.png" class="img-fluid" alt="">
            </div>
        </div>

<div class="featuted-product-wrap section-space--pt_120">
            <div class="container">
                <div class="row align-items-center featuted-product-one">
                    <div class="col-lg-6 col-md-6 order-md-2 order-1">
                        <div class="product-thumbnail">
                            <a href="shop-left-sidebar.html"><img src="images/df-2.png" class="img-fluid" alt="Featured Image"></a>
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 order-md-1 order-2">
                        <div class="featured-product-contect">
                            <h6 class="sub-heading mb-2">FEATURED PRODUCT</h6>
                            <h2 class="section-title--one"><a href="#">ДРУГАЯ КАТЕГОРИЯ</a></h2>
                            <p class="mt-30">Excepteur sint occaecat cupidatat non proident, sunt in culpaqui <br>
officia deserunt mollit anim id est laborum</p>
                            <div class="button-box section-space--mt_60">
                                <a href="shop-4-column.html" class="btn btn--md btn--border_1">Only $50 <i class="icon-arrow-right"></i></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="images-text-bg text-left">
                <img src="images/h1-1-300x122.png" class="img-fluid" alt="">
            </div>
        </div>

Link to comment
Share on other sites


а зачем js ? я ик понял вам нужен индивидуальный класс, то можно просто в php выводит номер элемени массива, типа order-<?php echo $i; ?>

Link to comment
Share on other sites

41 хвилину назад, Seriusis сказав:

а, у вас твиг, тогда

order-{{ loop.index }} пишите в класс

Можно подробнее?)Если можно в ЛС за монетку подсобите?

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.