index.php 7.01 KB

<script>
    $(document).ready(function() {

        $(window).load(function() {

            bottom = $('#bigSlider').position().top;

            //alert(currentScroll + " - " + bottom);

            currentScroll = $(window).scrollTop(); // get current position

            if (currentScroll > bottom) {           // apply position: fixed if you
                $('.bigSlidertabs').addClass('fixed');
                $('.bigSlidertabs').css({                      // scroll to that element or below it
                    position: 'fixed'
                });
            } else  {                                   // apply position: static
                $('.bigSlidertabs').removeClass('fixed');
                $('.bigSlidertabs').css({                      // if you scroll above it
                    position: 'absolute'
                });
            }

        });

        $(window).scroll(function() {                  // assign scroll event listener

            bottom = $('#bigSlider').position().top;

            //alert(currentScroll + " - " + bottom);

            currentScroll = $(window).scrollTop(); // get current position

            if (currentScroll > bottom) {           // apply position: fixed if you
                $('.bigSlidertabs').addClass('fixed');
                $('.bigSlidertabs').css({                      // scroll to that element or below it
                    position: 'fixed'
                });
            } else  {                                   // apply position: static
                $('.bigSlidertabs').removeClass('fixed');
                $('.bigSlidertabs').css({                      // if you scroll above it
                    position: 'absolute'
                });
            }

        });

        prev_img_url = $('#bigSlider #myCarousel').find('.item').last().find('img').attr('src');
        next_img_url = $('#bigSlider #myCarousel').find('.item').next().find('img').attr('src');

        $('#bigSlider #myCarousel').find('.img-nav.img-prev').attr('src',prev_img_url);
        $('#bigSlider #myCarousel').find('.img-nav.img-next').attr('src',next_img_url);

        $('#bigSlider #myCarousel').bind('slide.bs.carousel', function (e) {
            prev_img_url = $(this).find('.item.active').prev().find('img').attr('src');
            if(prev_img_url == undefined){
                prev_img_url = $('#bigSlider #myCarousel').find('.item').last().find('img').attr('src');
            }

            next_img_url = $(this).find('.item.active').next().find('img').attr('src');
            if(next_img_url == undefined){
                next_img_url = $('#bigSlider #myCarousel').find('.item').first().find('img').attr('src');
            }

            $(this).find('.img-nav.img-prev').attr('src',prev_img_url);
            $(this).find('.img-nav.img-next').attr('src',next_img_url);
        });

    });
</script>


<!---- SLIDER FOR Main page  ------->
<div id="bigSlider">
    <div id="myCarousel" class="carousel slide carousel-fade">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
            <li data-target="#myCarousel" data-slide-to="1"></li>
            <li data-target="#myCarousel" data-slide-to="2"></li>
            <li data-target="#myCarousel" data-slide-to="3"></li>
            <li data-target="#myCarousel" data-slide-to="4"></li>
            <li data-target="#myCarousel" data-slide-to="5"></li>
        </ol>

        <!-- Картинки в карусельке -->
        <div class="carousel-inner">
            <div class="active item">
                <a href="http://www.linija-svitla.ua/aktsiya.htm" title="При покупке светильника лампочка в подарок.*">                                  <img alt="При покупке светильника лампочка в подарок.*" src="http://www.linija-svitla.ua/res/custom/images/slider/lAMP FREE.jpg" />
                </a>
            </div>
            <div class="item">
                <a href="/detskie-15.htm" title="myKidsRoom">                                  <img alt="myKidsRoom" src="http://www.linija-svitla.ua/res/custom/images/slider/kids5w.jpg" />
                </a>
            </div>
            <div class="item">
                <a href="/sales.htm" title="Распродажа коллекций прошлых годов">                                  <img alt="Распродажа коллекций прошлых годов" src="http://www.linija-svitla.ua/res/custom/images/slider/Razprodaza.jpg" />
                </a>
            </div>
            <div class="item">
                <a href="http://www.linija-svitla.ua/light-topps-lt290209-8671.htm" title="iDual">                                  <img alt="iDual" src="http://www.linija-svitla.ua/res/custom/images/slider/iDual.jpg" />
                </a>
            </div>
            <div class="item">
                <img alt=" " src="http://www.linija-svitla.ua/res/custom/images/slider/3.jpg" />

            </div>
            <div class="item">
                <a href="/catalogues.htm" title="Модели">                                  <img alt="Модели" src="http://www.linija-svitla.ua/res/custom/images/slider/2.jpg" />
                </a>
            </div>
        </div>
        <!-- Навигационные элементы -->
        <a class="carousel-control left" href="#myCarousel" data-slide="prev">
            <span class="carousel-control-nav left"></span>
            <img class="img-nav img-prev" src="http://www.linija-svitla.ua/res/custom/images/slider/lAMP FREE.jpg" />
        </a>
        <a class="carousel-control right" href="#myCarousel" data-slide="next">
            <span class="carousel-control-nav right"></span>
            <img class="img-nav img-next" src="http://www.linija-svitla.ua/res/custom/images/slider/kids5w.jpg" />
        </a>
    </div>
    <!-- Табы для слайдера -->
    <div class="bigSlidertabs" >
        <div class="block-100">
            <div class="tab1">
                <a href="actionlist.htm">
                    <div class="tab_bg_1"></div>
                    <p>В данный момент у нас проходит <a href="actionlist.htm">25 акций</p></a>
                </a>
            </div>

            <div class="tab3">
                <a href="sales.htm">
                    <div class="tab_bg_3"></div>
                    <p>Вы можете значительно сэкономить при покупке. Посмотреть <a>все РАСПРОДАЖИ</a></p>
                </a>
            </div>
        </div>
    </div>


</div>




<div class="clearfix"></div>

<div class="block-100 margin-top-20 margin-bottom-40">
    <div class="container">
        <div class="slider_mp_items">
            <div class="catalog_product_list view_table">

                    <?= \common\modules\product\widgets\specialProducts::widget(['type' => 'top'])?>

            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>