Random-background generator

Size
2,353 Kb
Views
24,288

How do I make an random-background generator?

What is a random-background generator? How do you make a random-background generator? This script and codes were developed by Alejandro Zuniga on 02 January 2023, Monday.

Random-background generator Previews

Random-background generator - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>random-background generator</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 -->
<body class="bg1">
</body> <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-background generator - Script Codes CSS Codes

/* Presentation*/
.bg0 { background: url("https://s-media-cache-ak0.pinimg.com/originals/11/6b/de/116bde934197b8261112964b669a8ece.jpg"); max-width: 20%; max-height: auto;
}
.bg1 { background: url(http://people.oregonstate.edu/~petschec/PNWNT/forestmist.jpg); max-width: 20%; max-height: auto;
}
.bg2 { background: url(http://media.oregonlive.com/travel_impact/photo/misty-fjordsjpg-d8b3995379cb4108.jpg); max-width: 20%; max-height: auto;
}

Random-background generator - Script Codes JS Codes

// scripts.js
// Random Number Generator
var maxRand = 3;
var randNum = Math.floor( Math.random() * maxRand );
console.log(randNum);
// Get Body, Change Class to 'gb0', 'bg1', or 'bg2'
$('body').addClass( 'bg' + randNum );
Random-background generator - Script Codes
Random-background generator - Script Codes
Home Page Home
Developer Alejandro Zuniga
Username azuniga5
Uploaded January 02, 2023
Rating 3
Size 2,353 Kb
Views 24,288
Do you need developer help for Random-background generator?

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!