Closed vulcan9 closed 3 years ago
over
, down
상태의 cache 이미지
를 프리로딩 해 놓는다.over
, down
상태가 변할때 JS에서 style 속성 설정으로 이미지 상태를 설정하지 않는다.over
상태 : pseudo::hover
class 생성하여 적용down
상태 : pseudo::active
class 생성하여 적용cache
이미지를 프리로딩할때 주의할점다음 style 설정은 cache 이미지가 로드되지 않는다.
visibility: hidden;
인 경우opacity:0;
인 경우width: 0; height: 0;
인 경우화면에 지장을 주지 않도록 다음 style로 설정한다.
content: '';
width: 100%; height: 100%;
z-index: -9999;
pointer-events: none;
position: absolute;
}
런타임에 ~api.source() API 스크립트에 의해 이미지 소스가 동적으로 변경되는 경우 cache 이미지로 프리로드되지 않아 깜빡임이 발생할 수 있음
확인 완료
이미지로 롤오버튼을 만들면 실제 동작에서 마우스 롤오버를 반복할때마다 이미지 깜빡거림 현상이 나타남.
Chache 이미지 사용 옵션
을 사용하지 않을 경우 심하게 나타남Disable cache
옵션을 활성화 한 경우 깜빡임 현상 잘 나타남