http://cambridgeuplighting.com/portfolioUI 수정 : 슬라이드 쇼가 양쪽 끝에 도달했을 때 아무것도 나는 다음을 페이드 이전이 scrollTo 기능에 대한 제어하는 함수를 만들려고하고
스크롤 남아 있지 페이드 이전은/다음 컨트롤 . 나는 좋은 출발을 가지고 있지만 그것이 내가 원하는 방식으로 작동하지 않습니다. 컨트롤이 끝나기 전에 클릭을 페이드 아웃해야합니다. 지금은 끝까지 도달 한 다음 다음 클릭 (마지막에 스크롤하기 때문에 스크롤하지 않습니다)은 컨트롤을 희미하게 만듭니다.
다음은 내 코드입니다. 미리 감사드립니다.
jQuery를이
jQuery(function($){
var itemSize = $('div.portfolioPost').size();
var containerWidth = itemSize*240;
//set the width of the container depending on how many post items are there
$('#postContainer').css({'width': containerWidth })
//find the relative position of the end point by getting the negative value of the container width minus 961 (extra pixel is to account for IE difference)
var endPoint = 0-containerWidth+961;
$('.olderEvents').click(function() {
$('.newerEvents').fadeTo(350, 1.0)
var slidePos = $('#postContainer').position();
if (slidePos.left<=endPoint) {
$('.olderEvents').fadeTo(350, 0.1)
} else {
$('#slideScreen').scrollTo('+=960', 700);
}
});
$('.newerEvents').click(function() {
$('.olderEvents').fadeTo(350, 1.0)
var slidePos = $('#postContainer').position();
//relative position of 0 means the slideshow is at the other end
if (slidePos.left==0) {
$('.newerEvents').fadeTo(350, 0.1)
} else {
$('#slideScreen').scrollTo('-=960', 700);
}
});
});