Add draw functionality

This commit is contained in:
Gergely Polonkai 2014-10-29 23:39:30 +01:00
parent 009491c52f
commit b491f8ceed

View File

@ -60,6 +60,8 @@
<option value="pisces">Halak / Pisces</option>
</select>
<button id="draw">Húzz egyet / Draw one</button>
<hr>
<div id="holder">
@ -515,6 +517,18 @@
$(window).resize(function () {
resize_holder();
});
$('#draw').click(function () {
count = $('div.card').length;
draw_num = Math.floor(Math.random() * count) + 1;
num_str = (draw_num < 10) ? '0' + draw_num : draw_num;
draw_id = '#card_' + num_str;
console.log(draw_id);
$(draw_id).click();
});
</script>
</body>
</html>