Random-image

Size
1,986 Kb
Views
12,144

How do I make an random-image?

What is a random-image? How do you make a random-image? This script and codes were developed by Alejandro Zuniga on 25 December 2022, Sunday.

Random-image Previews

Random-image - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>random-image</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- index.html -->
<!-- Random Backround -->
<img src="http://placehold.it/200" alt="" /> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Random-image - Script Codes CSS Codes

img { border: 10px solid red; border-radius: 4px;
}

Random-image - Script Codes JS Codes

// scripts.js
// Store Banner Images
var img0 = 'https://unsplash.it/300';
var img1 = 'https://unsplash.it/400';
var img2 = 'https://unsplash.it/500';
// Random Number Generator
var maxRand = 3;
var randNum = Math.floor( Math.random() * maxRand );
console.log(randNum);
// Change Image
$('img').attr( 'src', eval('img' + randNum) );
Random-image - Script Codes
Random-image - Script Codes
Home Page Home
Developer Alejandro Zuniga
Username azuniga5
Uploaded December 25, 2022
Rating 3
Size 1,986 Kb
Views 12,144
Do you need developer help for Random-image?

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!

Alejandro Zuniga (azuniga5) Script Codes
Create amazing blog posts with AI!

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!