Giter Site home page Giter Site logo

kikuri / randombackground.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaelbragg/randombackground.js

0.0 2.0 0.0 383 KB

Attach a random background image to an element from a user supplied list on page load

License: MIT License

JavaScript 100.00%

randombackground.js's Introduction

RandomBackground.js

Attach a random background image to an element from a user supplied list on page load.

Usage

1, Include jQuery:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>

2, Include plugin's code:

<script src="dist/jquery.randombackground.min.js"></script>

3, Call the plugin To extend the default config settings pass a object as an argument for the init function eg, randomBackground.init({ images: 'image01.jpg', 'image02.jpg' });

$(document).ready(function() {

  // To extend the default config settings
  // pass a object as an argument for the init function
  // eg. randomBackground.init({ images: 'image01.jpg', 'image02.jpg' });

  randomBackground.init( { parent: '.hero', background: '.hero', path: 'demo/img/', images: ['background_01.png', 'background_02.jpg', 'background_03.jpg'], bgcolor: ['#000', '#ccc', '#fafafa'] });

});

Licence

Copyright © 2014 Michael Bragg | Code licensed under the MIT License.

randombackground.js's People

Contributors

michaelbragg avatar

Watchers

James Cloos avatar kikuri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.