0
내가 현재 scrollTop
을 얻을하고 다음 코드를 사용하여 특정 높이에 애니메이션을 만들 수 있어요 mCustomScollbarjQuery를 사용자 지정 콘텐츠 스크롤의 애니메이션
로 스크롤하는 동안 애니메이션을 만들려고 노력 해요 :
$("#content").mCustomScrollbar({
scrollButtons:{
enable:true
},
advanced:{
updateOnContentResize: true,
updateOnBrowserResize: true,
},
callbacks:{
onScrollStart:function(){ onScrollStart(); },
whileScrolling:function(){ WhileScrolling(); }
}
});
function WhileScrolling(){
var top = Math.abs(mcs.top);
if(top > 180){
$('#topbar').animate({opacity:'0'});
}
한 번 추가
이
if(top < 180){
$('#topbar').animate({opacity:'1'});
}
이 부분이 실패하고는 animate({opacity:0})
SOM :하지만이 코드를 뒤쪽으로 애니메이션을 만들려고하면
ehow는 애니메이션을 시작하기 전에 오랜 시간이 걸립니다.
미리보기 :
Thwn for awnser, 그것은 정지 기능이 아니었지만. .fadeOut() 및 .fadeIn()을 사용하여 수정 한 것으로 보입니다. – user2449373