Get started with jquery-backstretch CDN
MIT licensed
JQuery-backstretch: Set full-screen images easily with this lightweight plugin.
Tags:- background
- dynamic
- jquery
Stable version
Copied!
How to start using jquery-backstretch CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with jquery-backstretch CDN - cdnhub.io</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<style>
.container {
height: 100vh;
}
</style>
<script src="https://cdn.cdnhub.io/jquery-backstretch/2.1.18/jquery.backstretch.min.js"></script>
</head>
<body>
<div id="background"></div>
<script>
$(document).ready(function() {
$('#background').backstretch('path/to/image1.jpg', { fade: 1000 });
$('#background').bind('load', function() {
$('#background').backstretch('path/to/image2.jpg', { fade: 1000 });
});
});
</script>
</body>
</html>
Copied!
Copied!