JSFiddle - React, Tailwind, and code Playground

HTML

<div id="top">
    <div id="slider">
        <div class="arrow">
            <a class="next" href="javascript:void(0)" title="Next" onclick="next_slide()"></a>
            <a class="prev" href="javascript:void(0)" title="Preview" onclick="prev_slide()"></a>
        </div>
        <ul>
            <li id="li1" class="showed"><img src="http://s3.picofile.com/file/8193480550/001.jpg" alt="" class="slider_img"/></li>
            <li id="li2"><img src="http://s6.picofile.com/file/8193480576/002.jpg" alt="" class="slider_img"/></li>
            <li id="li3"><img src="http://s3.picofile.com/file/8193480592/003.jpg" alt="" class="slider_img"/></li>
            <li id="li4"><img src="http://s6.picofile.com/file/8193480618/004.jpg" alt="" class="slider_img"/></li>
        </ul>
    </div>
</div>

CSS

#top {
    width:100%;
    height:450px;
    position:relative;
    direction: rtl;
}
#slider {
    width:100%;
    background:#006699;
    height: 100%;
    overflow: hidden;
    float:right;
    position: absolute;
    top:0;
    right:0;
    z-index:1;
}
#slider ul {
    width:100%;
    height:100%;
    position: relative;
}
#slider ul li {
    display:none;
    position: absolute;
    top: 0;
    left: 0;
    width:100%;
    height:100%;
}
#slider .showed {display:block;}
#slider ul li img {
    width:100%;
    height:100%;
}
#slider .arrow {
    width:100px;
    height:60px;
    position:absolute;
    bottom:20px;
    right:60px;
    z-index:13;
}
#slider .arrow a {
    width:36px;
    height:60px;
    background:url(http://s3.picofile.com/file/8193480534/next.png) no-repeat center;
    float:right;
    margin:0 5px;
    opacity:0.5;
}
#slider .arrow a.prev {
    float:left;
    background-image: url(http://s3.picofile.com/file/8193480492/prev.png);
}
#slider .arrow a:hover {
    opacity:1;
}

JavaScript

function next_slide(){
    $("#slider ul li").each(function(){
      thisdisplay = $(this).css("display");
      if(thisdisplay=='block'){
        thisid = $(this);
        nextid_name = $(this).next().attr("id");
        if(nextid_name) nextid = $(this).next();
        else nextid = $("#slider ul li").first();
      }
    });
        $(nextid).css({"display" : "block"});
        $(thisid).css("z-index", "2").fadeOut(1000, function(){
            $(thisid).css("z-index", "1");
        });
}
function prev_slide(){
    $("#slider ul li").each(function(){
      thisdisplay = $(this).css("display");
      if(thisdisplay=='block'){
        previd_name = $(this).prev().attr("id");
        
        if(previd_name) previd = $(this).prev();
        else previd = $("#slider ul li").last();
        thisid = $(this);
      }
    });
        $(previd).css("display" , "block");
        $(thisid).css("z-index", "2").fadeOut(1000, function(){
            $(thisid).css("z-index", "1");
        });
}