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 |
Those kids... | 3,390 Kb |
Three.js shooter template | 6,268 Kb |
Responsive activity calendar | 3,850 Kb |
ROTATING IMAGE SLIDER WITH JQUERY | 5,062 Kb |
Touch Slider | 3,587 Kb |
Catslicer | 2,957 Kb |
Canvas Buldings | 2,737 Kb |
Roulette | 2,417 Kb |
A Pen by Theun | 6,152 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 |
Clock with full screen background | Owebboy | 2,415 Kb |
Two column of responsive height | Fixie | 2,908 Kb |
Mosaic transition effect between two photos using jQuery | Stathisg | 2,518 Kb |
Underlined form fields | Mitchdot | 2,323 Kb |
Css or Czz.. | Judag | 4,111 Kb |
Multiple jCarousel | Pafnuty | 2,461 Kb |
Calendar | Miroot | 2,033 Kb |
Image Hover | Johnheiner | 3,409 Kb |
Front in Aracaju Logo Pure CSS | Shankarcabus | 2,581 Kb |
Flower expansion | Sreucherand | 3,425 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!