카테고리 없음

[자바 스크립트] jQuery에서 클릭시 .fadeIn 및 .fadeOut 문제

행복을전해요 2021. 2. 20. 08:53

콜백에서 함수를 함께 연결합니다.

$(".full img").fadeOut(function() {
    $(".full img").attr("src", largeImg);
        $(".full img").fadeIn();
        });
        
-------------------

fadeOut에 콜백을 전달할 수 있습니다.

$(".full img").fadeOut('slow', function() {
    $(".full img").attr("src", largeImg);
        $(".full img").fadeIn('fast');
        });
        


출처
https://stackoverflow.com/questions/22079925