jquery-background-img
1.0.1 • Public • Published jquery-background-img
Plug-in de jquery para cambiar el fondo con imagenes random
Installation
npm install jquery-background-img
You need to load jQuery first
<script src="/node_modules/jquery/dist/jquery-js"></script>
<script src="/node_modules/jquery-background-img/src/index.js"></script>
Before using the Unsplash API you need to register as developer. Then you must put the CLIENT_ID to be enable to get photos from Unsplash API.
window.BackgroundImg.setup(clientId);
How it works?
<div id="bg-unsplash"></div>
$(document).ready(function(){
window.BackgroundImg.setup(clientId);
$('#bg-unsplash').BackgroundImg({
minHeight: '700px',
backgroundSize: 'contain',
backgroundPosition: 'top center',
backgroundColor: 'black',
});
});
Package Sidebar
Install
npm i jquery-background-img
Weekly Downloads