如何循环淡入淡出图片

循环过程中出现两个图片重合

img


img


img


```javascript

var s2 = document.documentElement.scrollTop;                                                                
                    if(s2 > "700")
                    {
                        $(".main:nth-child(2)").css("mix-blend-mode","multiply");
                        $(".main:nth-child(2)").animate({opacity:"0.8"},2000,function(){
                            zh();
                        });
                    }
                    function zh(){
                        $(".per2 img:nth-child(2)").animate({opacity:"0"},2000,function(){
                            $(".per2 img:nth-child(3)").animate({opacity:"0.8"},2000,function(){
                                $(".per2 img:nth-child(3)").animate({opacity:"0"},2000,function(){
                                    $(".per2 img:nth-child(2)").animate({opacity:"0.8"},2000,function(){
                                        zh();
                                    })
                                })
                            })
                        })
                    }

```

网上的插件库很多https://www.jq22.com/