I는 다음과 같이보고 코드를 유지 :Jquery methods?
$(document.documentElement).keyup(function(event) {
var slides = $('#slides .pagination li'),
current = slides.filter('.current');
switch(event.keyCode) {
case 37: // Left arrow
if (slides.filter(':first').is(current)) {
slides.filter(':last').find('a').click();
} else {
slides.eq(slides.index(current) - 1).find('a').click();
}
break;
case 39: // Right arrow
if (slides.filter(':last').is(current)) {
slides.filter(':first').find('a').click();
} else {
current.find('+ li').filter(':first').find('a').click();
}
break;
}
});
과 같은 라인 : current = slides.filter('.current');
, .filter()
, 오른쪽 JQuery와 방법? 그렇다면 그것은 current = $(slides).filter('.current');
이되어서는 안됩니다.
코드에서 수행되는 방식대로 작동합니까? 왜?
'$()'는 jQuery 객체를 반환하는 함수입니다. 이제 해당 객체에는 jQuery 함수가 있습니다. –