Rev 25502 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<style>#carousel {position: relative;height: 700px;width:70%;top: 50%;margin:auto;//transform: translateY(-50%);overflow: hidden;}#carousel div {position: absolute;transition: transform 1s, left 1s, opacity 1s, z-index 0s;opacity: 1;}#carousel div img {width: 400px;transition: width 1s;}#carousel div.hideLeft {left: 0%;opacity: 0;transform: translateY(50%) translateX(-50%);}#carousel div.hideLeft img {width: 200px;}#carousel div.hideRight {left: 100%;opacity: 0;transform: translateY(50%) translateX(-50%);}#carousel div.hideRight img {width: 200px;}#carousel div.prev {z-index: 5;left: 30%;transform: translateY(50px) translateX(-50%);}#carousel div.prev img {width: 300px;}#carousel div.prevLeftSecond {z-index: 4;left: 15%;transform: translateY(50%) translateX(-50%);opacity: 0.7;}#carousel div.prevLeftSecond img {width: 200px;}#carousel div.selected {z-index: 10;left: 50%;transform: translateY(0px) translateX(-50%);}#carousel div.next {z-index: 5;left: 70%;transform: translateY(50px) translateX(-50%);}#carousel div.next img {width: 300px;}#carousel div.nextRightSecond {z-index: 4;left: 85%;transform: translateY(50%) translateX(-50%);opacity: 0.7;}#carousel div.nextRightSecond img {width: 200px;}.buttons {position: fixed;left: 50%;transform: translateX(-50%);bottom: 10px;}</style><section class="wrapper"><div class="row"><div style="align:center" id="carousel"><div class="hideLeft"><img src="resources/images/rising_star_new.png"></div><div class="prevLeftSecond"><img src="resources/images/bronze_new.png"></div><div class="prev"><img src="resources/images/silver_new.png"></div><div class="selected"><img src="resources/images/gold_new.png"></div><div class="next"><img src="resources/images/diamond_new.png"></div><div class="nextRightSecond"><img src="resources/images/platnium_new.png"></div></div></div></section><script>function moveToSelected(element) {if (element == "next") {var selected = $(".selected").next();} else if (element == "prev") {var selected = $(".selected").prev();} else {var selected = element;}var next = $(selected).next();var prev = $(selected).prev();var prevSecond = $(prev).prev();var nextSecond = $(next).next();$(selected).removeClass().addClass("selected");$(prev).removeClass().addClass("prev");$(next).removeClass().addClass("next");$(nextSecond).removeClass().addClass("nextRightSecond");$(prevSecond).removeClass().addClass("prevLeftSecond");$(nextSecond).nextAll().removeClass().addClass('hideRight');$(prevSecond).prevAll().removeClass().addClass('hideLeft');}// Eventos teclado$(document).keydown(function(e) {switch(e.which) {case 37: // leftmoveToSelected('prev');break;case 39: // rightmoveToSelected('next');break;default: return;}e.preventDefault();});$('#carousel div').click(function() {moveToSelected($(this));});$('#prev').click(function() {moveToSelected('prev');});$('#next').click(function() {moveToSelected('next');});</script>