2012-07-12 2 views
3

#news div에 도달하면 아래로 슬라이드하는 요소가 있고 위로 슬라이드하면 #news를 전달할 때 위로 슬라이드됩니다.jQuery 제거 웨이 포인트

$(document).ready(function() { 
$('#news').waypoint(function(event, direction) { 
    if (direction === 'down') { 
    $('#menu_list').animate({top: 10},{queue: false, duration:500}) ;} 
    else { 
    $('#menu_list').animate({top: 50},{queue: false, duration:500}) ;} 
     }, { 
    offset: '6' 
    }); 
}); 

".waypoint ('remove') '를 적용하는 방법을 알고 싶습니다. div를 떠날 때 슬라이드를 올리려면 사이트를 더 멀리 아래로 슬라이딩하고 다른 div로 이동하십시오. 이렇게하면 슬라이드를 넣거나 멈출 때처럼 애니메이션을 만들 수 있습니다.

웨이 포인트가 올바른 플러그인이 아닌 경우 이러한 효과를 얻는 방법에 대해 약간의 조언을 해주시면 감사하겠습니다.

감사합니다.

답변

7
$('#news').waypoint('destroy') — Unregister waypoints and unbind all handlers. 
$('#news').waypoint('remove') — Unregister waypoints but leave handlers intact. 

웨이 포인트 전체 문서를 읽었습니까 ??

의 Src : http://imakewebthings.com/jquery-waypoints/#documentation

+0

네, $를 넣을 때 ('# 뉴스') 웨이 포인트, 코드에 ('제거')이 때이 instatly 제거가 아니라 #news div에 도달 한 후, 그리고됩니다. 제거하면 'else'가 작동하지 않습니다. – user1519385

관련 문제