npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

jq-bgrandom

1.0.1 • Public • Published

jq-BgRandom

Change full random background

Installation

$   npm install jq-BgRandom
You need to load jQuery first
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/jq-bgRandom/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.

window.BgRandom.setup(clientId);

How it works?

<div id="bg-unsplash"></div>
$(document).ready(function() {
    window.BgRandom.setup(clientId);
    $('#bg-unsplash').bgRandom({
      minHeight: '700px', // by default it´s 800px
      backgroundSize: 'contain', // by default it´s cover
      backgroundPosition: 'top center', // by default its center
      backgroundColor: 'red' // by default it´s black
    });
});

install

npm i jq-bgrandom

Downloadsweekly downloads

0

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability