안녕하세요 여러분, jQuery 선택기의 범위를 제한하는 데 문제가 있습니다.jQuery 선택기의 범위를 올바르게 설정하십시오.
<ul id="caption">
<li class="visible">
<p>
SwitchPoint Solutions is a leading provider of automated configuration solutions for telecommunications carriers globally.
We offer services in the TDM network optimization, TDM to VoIP migration, and hosted PBX/Contact Centre areas.
</p>
<a href="#" class="button">Let's Go</a>
</li>
<li>
<h2>TurboMove</h2>
<p>
An automated optimization solution that helps carriers:
<li>Extend TDM network lifecycles</li>
<li>Decrease operating expenses (OPEX)</li>
<li>Decrease total cost of ownership (TCO)</li>
<li>Decrease carbon footprint</li>
</p>
<a href="#" class="button">Let's Go</a>
</li>
<li>
<h2>Exodus</h2>
<p>
Automates the data move during the of the migration TDM to VoIP. Some of its main features are: automated data move,
data integrity checks, and maintaining recent changes made by the subscriber.
</p>
<a href="#" class="button">Let's Go</a>
</li>
더 많은 목록 요소가 있지만 간결성을 위해 그들을 포함하지 않았다 다음과 같이 나는 구조 정렬되지 않은 목록에 따라 슬라이드 쇼 위젯을 만들었습니다. 기본적으로 각 캡션은 표시된 클래스를 표식으로 사용하여 전환됩니다. 다음과 같이, 스위칭 용 실제 코드는 다음
function autoSlideshow(mode) {
var currentImage = $('#gallery li.visible'); //Determine which slide is visible
var currentCaption = $('#caption li.visible');
var currentSlide = $('#controls a.pagination.visible');
var transitionSpeed = 750;
if(mode == -1){
var nextImage = currentImage.next().length ? currentImage.next() : //Determine the next slide
currentImage.siblings(':first');
var nextCaption = currentCaption.next().length ? currentCaption.next() :
currentCaption.siblings(':first');
var nextSlide = currentSlide.next().length ? currentSlide.next() :
currentSlide.siblings(':eq(1)');
}
else{
var nextImage = $('#gallery li:eq('+mode+')');
var nextCaption = $('#caption li:eq('+mode+')');
var nextSlide = $('#controls a.pagination:eq('+mode+')');
}
currentImage.fadeOut(transitionSpeed).removeClass('visible');
nextImage.fadeIn(transitionSpeed).addClass('visible');
currentCaption.fadeOut(transitionSpeed).removeClass('visible');
nextCaption.fadeIn(transitionSpeed).addClass('visible');
currentSlide.removeClass('visible');
nextSlide.addClass('visible');
}
제가하는 데 문제는 자막 ID가 정렬되지 않은리스트의 두 번째 목록 요소 만 중첩 된 목록을 표시 그것에 중첩리스트 요소를 갖는다는 것이다 한 번에 하나의 요소!
나는이 선택기의 범위를 제대로 제한하지 않는다고 가정합니다. $ ('caption li.visible'); 그러나 목록의 한 수준 만 선택하도록 선택기를 제한하는 방법을 알아낼 수 없었습니다. 나는 이것이 newb-ish 두뇌가 복잡하지 않다는 것을 확신한다.
오해. 죄송합니다. 나는 슬라이드 쇼가 중첩 된 목록을 뒤집지 않고 포함되지 않은 목록 (이 경우 id = "caption")의 목록 요소를 뒤집기를 원한다는 것을 의미했습니다. 기본적으로 슬라이드 쇼 전환에서 중첩되지 않은 목록을 분리하려고합니다. – mrGupta