logic to spin the 3 images when the SPIN NOW button is clicked.
After the spin is finished, user earns either 200 points or 500 points depending on the sequence of the result of the spin.
1) When All the 3 images are same, user gets 500 points which he can use to redeem products. 2) When At least 2 images are same, user gets 200 points which he can use to redeem products. 3) When none is the same show failure message.
following are the code of change images.
<script>
var randomImage = new Array();
randomImage[0] = "images/01.jpg";
randomImage[1] = "images/02.jpg";
randomImage[2] = "images/03.jpg";
$(function() {
$('.click').click(function(e) {
e.preventDefault();
var number = Math.floor(Math.random() * randomImage.length);
$("#bg").html('<img width="250px" height="250px" src="' + randomImage[number] + '" />');
});
$('.click').click(function(e) {
e.preventDefault();
var number = Math.floor(Math.random() * randomImage.length);
$("#bga").html('<img width="250px" height="250px" src="' + randomImage[number] + '" />');
});
$('.click').click(function(e) {
e.preventDefault();
var number = Math.floor(Math.random() * randomImage.length);
$("#bgab").html('<img width="250px" height="250px" src="' + randomImage[number] + '" />');
});
});
</script>
User Should be able to play only thrice. When he plays 4th time, he should be asked to wait for 30 mins to play again.
Please use this, this this the easiest demo code. you need to also add your logic.