Algo parecido a este, pero este hace un bucle infinito... busco la forma de que no vuelva al boton1 y que se quede en el boton3 o que desaparezca el boton3
Cita:
<script type="text/javascript">
function clickMe(element) {
element = $(element);
var next = element.attr('data-rel');
//alert(element.attr('data-text')); //show value
element.hide(); //hide element
$('button.' + next).show(); //show next button
}</script>
function clickMe(element) {
element = $(element);
var next = element.attr('data-rel');
//alert(element.attr('data-text')); //show value
element.hide(); //hide element
$('button.' + next).show(); //show next button
}</script>
Cita:
<button class="button-1" data-rel="button-2" data-text="Value 1" onclick="clickMe(this);">Button 1</button>
<button style="display:none;" class="button-2" data-rel="button-3" data-text="Value 2" onclick="clickMe(this);">Button 2</button>
<button style="display:none;" class="button-3" data-rel="button-1" data-text="Value 3" onclick="clickMe(this);">Button 3</button>
<button style="display:none;" class="button-2" data-rel="button-3" data-text="Value 2" onclick="clickMe(this);">Button 2</button>
<button style="display:none;" class="button-3" data-rel="button-1" data-text="Value 3" onclick="clickMe(this);">Button 3</button>