2016-01-14 2 views
1

jCarousel вертикальная прокрутка не работает

$(function() { 
 
$('.jcarousel') 
 
\t \t \t \t .jcarousel({ 
 
\t \t \t \t \t auto: 1, 
 
\t \t \t \t \t animation: { 
 
\t \t \t \t \t \t duration: 3000, 
 
\t \t \t \t \t \t easing: 'linear', 
 
\t \t \t \t \t }, 
 
\t \t \t \t \t vertical: true, 
 
\t \t \t \t \t wrap: 'last' 
 
\t \t \t }).jcarouselAutoscroll({ 
 
\t \t \t \t \t interval: 3000, 
 
\t \t \t \t \t target: '+=1', 
 
\t \t \t \t \t autostart: true 
 
\t \t \t \t }); 
 
});
ul li { 
 
    list-style-type: none; 
 
} 
 

 
.jcarousel { 
 
    position: relative; 
 
    overflow: hidden; 
 
    width: 100%; 
 
    height: 88px; 
 
} 
 

 
.jcarousel li { 
 
    float: left; 
 
    width: 100%; 
 
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jcarousel/0.3.4/jquery.jcarousel.js"></script> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div class="row"> 
 
    <div class="jcarousel"> 
 
    <ul> 
 
     <li> 
 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has 
 
     survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
 
     publishing software like Aldus PageMaker including versions of Lorem Ipsum.</li> 
 
     <li> 
 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has 
 
     survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
 
     publishing software like Aldus PageMaker including versions of Lorem Ipsum.</li> 
 
     <li> 
 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has 
 
     survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
 
     publishing software like Aldus PageMaker including versions of Lorem Ipsum.</li> 
 
     <li> 
 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has 
 
     survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
 
     publishing software like Aldus PageMaker including versions of Lorem Ipsum.</li> 
 
     <li> 
 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has 
 
     survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
 
     publishing software like Aldus PageMaker including versions of Lorem Ipsum.</li> 
 
    </ul> 
 
    </div> 
 
</div>

Контейнер уль показывает вычисленное изменение стиля в верхнем положении, но содержание карусели не суммируется и не свитка. Пожалуйста помоги. Это jCarousel Version. Вот мой Codepen. Просто нужно, чтобы этот последний кусок вертикального свитка работал.

ответ

2

Его не прокрутка, потому что вам не хватает этот CSS:

.jcarousel ul { 
    position: relative; 
} 

Если посмотреть на инспекторе DOM он применяет top и left стиля, но ничего не двигается. Это потому, что стиль применяется к ul, но ему необходимо position: relative. Вам нужно будет играть с вашими высотами и немного больше, теперь, когда он прокручивает, чтобы получить эффект, который вы хотите, но теперь вы должны начать видеть, что ожидаете.

EDIT: Извините, я пропустил то, что вы четко заявили, что видели, что применяемый стиль уже применен. В любом случае добавьте выше CSS и он должен начать работать.

+1

спасибо !!!! Фантастично, что ты за помощь! – alphapilgrim

+0

Рад помочь! Удачи! – AtheistP3ace

Смежные вопросы