HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/komma.pro/wwwroot/challenges/roulette.js
$(function(){
	var p = {

		speed: 15,
		duration: 2,
		stopImageNumber: 1,
		originalStopImageNumber: 1,

		startCallback : function() {
			$('.start').attr('disabled', 'true');
			// $('.stop').removeAttr('disabled');
		},
		// slowDownCallback : function() {
		// 	$('.stop').attr('disabled', 'true');
		// },
		stopCallback : function($stopElm, $ex) {
			
			const el = $stopElm[0];

			$('.selected').html(el.getAttribute('data-name'));
			$('.start').removeAttr('disabled');
			// $('.stop').attr('disabled', 'true');
		}
	}

	var rouletter = $('div.roulette');
	rouletter.roulette(p);

	$('.start').click(function(){
		console.log($('.roulette img').length);
		p['stopImageNumber'] = Math.floor(Math.random() * ($('.roulette img').length - 1) );
		rouletter.roulette('option', p);

		rouletter.roulette('start');
	});
});