1 <h1>2 Cards stack3 <button onclick="pushCard()">Push card</button>4 <button onclick="popCard()">Pop card</button>5 </h1>6 7 <div id="frame"></div>8 9 <script type="text/javascript">10 11 var card_counter = 1;12 var frame = document.getElementById('frame');13 var stack = new StackCards(frame);14 15 function pushCard() {16 var new_card = new Card();17 new_card.dom.innerHTML = 'Card '+(card_counter++);18 stack.push(new_card);19 }20 21 function popCard() {22 stack.pop();23 }24 25 </script>26 27 28 <style type="text/css">29 #frame {30 position:absolute;31 width:200px;32 height:300px;33 border:solid;34 }35 36 #frame [b="Card"] {37 background-color:lightblue;38 }39 </style>
Este ShareCode tiene versiones:
- Cards stack Push card Pop c... (24/04/2013)
- Cards stack Push card Pop c... (24/04/2013)
- Cards stack Push card Pop c... (24/04/2013)
- Cards stack Push card Pop c... (24/04/2013)
Enlace
El enlace para compartir es: