var block = $(".cube"); var index_img = 1; var cur = 1; var next = cur + 1; var img = $(".cube div"); var button = $(".button"); var deg = 90; var images = new Array("http://www.avataris-faun.ru/avatars_200x200/436.jpg","http://images.stopgame.ru/uploads/avatars/avatar_303989.gif","http://stat18.privet.ru/ah/0a2120f74a5258b7e57c50238f9126e0","http://stat21.privet.ru/lr/0c13092ff81da25919bf841ece0eafd8","http://i2.guns.ru/forums/icons/forum_pictures/000743/743965.jpg"); img[cur-1].style.boxShadow = "inset 0px 0px 20px 0px rgba(0,0,0,0.1)"; $(button).click(function (){ index_img = $(this).index(); for(h=0;h > 4;h++) { if (h!==(cur-1)) { img[h].style.boxShadow = "none"; } } if ( cur > 3) { cur = 0; } img[cur].style.background = "url(" + images[index_img] + ")"; block[0].style.transform = "rotate3d(1,0,0," + deg + "deg)"; img[cur-1].style.boxShadow = "inset 0px 200px 20px 0px rgba(0,0,0,0.3)"; deg = deg + 90; cur++; }); 

There is a 3D cube. Image Slider. He constantly turns on x at 90 degrees. For each turn, the next picture changes to the selected one. I also added boxing shadow. 4 times working fine, but then freezes. How can I clear the shadow of other blocks? Tried to make a loop so that in all blocks except the current one, the shadow was "none". Does not work. Total. Create a shadow for the two blocks that fall within the scope, and clear the shadow from the other two.

    0