JSFiddle - React, Tailwind, and code Playground

by Prashant Tapase

JavaScript

$(document).ready(function(){
   var index_1 = '';
     var index_2 = '';
//    if(index_1==index_2){
//        console.log(same);
//    }
    $('#spin-now').click(function(){
 
        $(".spin-box-1").jCarouselLite({
            auto: 200,
            speed: 200,
            visible: 1,
            vertical: true,
            easing: "easeOutBounce",
                afterEnd: function(a) {
                     var index_1 = $(a[0]).index();
                     store_index_1(index_1,'');    
                }
        });
        
        $(".spin-box-2").jCarouselLite({
            auto: 225,
            speed: 225,
            visible: 1,
            vertical: true,
            easing: "easeOutBounce",
                afterEnd: function(a) {
                     var index_2 = $(a[0]).index();
                     store_index_1('',index_2);
                }
        });
        
        $(".spin-box-3").jCarouselLite({
            auto: 250,
            speed: 250,
            visible: 1,
            vertical: true,
            easing: "easeOutBounce",
//                afterEnd: function(a) {
//                     var index_3 = $(a[0]).index();
//                    // store_index_3(index_3);
//                }
        });
   
  
    });
 
            function store_index_1(x,y){
                data_index_1 = x;
                data_index_2 = y;
                           console.log('outside'+''+data_index_1+''+data_index_2);  
            }

//console.log(data_index_1);
    
     setInterval(function(){ 
        var x = setTimeout("");
        for (var i = 0 ; i < x ; i++)
        clearTimeout(i);
     }, 5000);   
     
});