Roulette
How do I make an roulette?
What is a roulette? How do you make a roulette? This script and codes were developed by Theun on 02 November 2022, Wednesday.
Roulette - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>roulette</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="roulette"></div>
<button id='start'> start </button>
<button id='stop'> stop </button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Roulette - Script Codes CSS Codes
* { margin: 0; padding: 0; border: 0;
}
#roulette {
width: 100%;
}
body { background: #666; font: 30px Verdana;
}
button{ padding: 5px; border: 2px;
}
Roulette - Script Codes JS Codes
var preloads = [], images = [ 'http://fc01.deviantart.net/fs71/f/2011/097/2/c/melody_roulette_wheel_by_wheelgenius-d3dflqw.jpg', 'http://khaosok-smiley.com/wp-content/gallery/miscellaneous/green_smiley.png', 'http://www.jpl.nasa.gov/images/earth/earth2-browse.jpg', 'http://www.rivercitypizza.com/PepperoniPizza-full.jpg', 'http://www.dailyfork.com/Donut.gif', 'http://i00.twenga.com/games/stuurwiel-pc/logitech-g27-racing-wheel-p_542951vb.jpg' ];
function preload(img_path) { var $dfd = $.Deferred; $('<img />').attr('src', img_path).load(function() { $dfd.resolved(); });
}
for(var i = 0; i < images.length; ++i) { preloads.push(preload(images[i]));
}
$.when.apply($, preloads).done(function() { var roulette = new Roulette; $('#start').click(roulette.start); $('#stop').click(roulette.stop);
});
function Roulette() { var index = 0, image = new Image, speed = 50, isStarting = false, isStopping = false, isStop = false; init(); function init() { image.src = images[0]; image.width = 300; image.height = 300; $('#roulette').append(image); } function change() { if (index >= images.length) index = 0; image.src = images[index]; if (isStop === false) { index++; setTimeout(change, speed); } else { images.splice(index, 1); isStarting = false; } } function start() { if (isStarting === true) return; isStop = false; isStarting = true; change(); } function stop() { if (isStopping === true) return; isStopping = true; speed = 200; setTimeout(function() { speed = 500; }, 1000); setTimeout(function() { speed = 50; isStop = true; isStopping = false; }, 2500); } return { start: start, stop: stop };
}
Developer | Theun |
Username | tjoen |
Uploaded | November 02, 2022 |
Rating | 3 |
Size | 2,417 Kb |
Views | 28,336 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Font Awesome Cheetsheet | 7,878 Kb |
SVG pong | 3,818 Kb |
Those kids... | 3,390 Kb |
ROTATING IMAGE SLIDER WITH JQUERY | 5,062 Kb |
Canvas Buldings | 2,737 Kb |
Responsive activity calendar | 3,850 Kb |
A Pen by Theun | 6,152 Kb |
Catslicer | 2,957 Kb |
Three.js shooter template | 6,268 Kb |
City block generator | 2,897 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Fluid Layout with Float | Jxqr97 | 1,785 Kb |
TweenMax transformOrigin Bubble | Nicolund | 2,209 Kb |
TheCalendar.js | The-teacher | 6,330 Kb |
Whyutils | LeYvan | 3,752 Kb |
Glowing Pulse Form | Jackrugile | 2,542 Kb |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 Kb |
Simple personal profile | Miroot | 2,856 Kb |
Arrow Navigation | Hinducows | 1,973 Kb |
NgEasyModal | Lorenzodianni | 4,159 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!